Getting "Handshake status 404 Not Found" when setting up AppDaemon

I am trying to install AppDaemon and have followed the instructions for installing in Docker, however when I run AD it cannot connect to HA and (repeatedly) throws the following exception:

2020-03-24 20:09:07.568299 DEBUG HASS: Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/appdaemon/plugins/hass/hassplugin.py", line 224, in get_updates
    self.ws = websocket.create_connection(
  File "/usr/local/lib/python3.8/site-packages/websocket/_core.py", line 515, in create_connection
    websock.connect(url, **options)
  File "/usr/local/lib/python3.8/site-packages/websocket/_core.py", line 226, in connect
    self.handshake_response = handshake(self.sock, *addrs, **options)
  File "/usr/local/lib/python3.8/site-packages/websocket/_handshake.py", line 80, in handshake
    status, resp = _get_resp_headers(sock)
  File "/usr/local/lib/python3.8/site-packages/websocket/_handshake.py", line 165, in _get_resp_headers
    raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers)
websocket._exceptions.WebSocketBadStatusException: Handshake status 404 Not Found

I am running AppDaemon using the following command:

docker run --rm -it -p 5050:5050 -v /Volumes/docker/home-assistant-appdaemon:/conf acockburn/appdaemon:latest -D DEBUG

My appdaemon.yaml looks like:

appdaemon:
  latitude: -37.XXX
  longitude: 175.XXX
  elevation: 40
  time_zone: Pacific/Auckland
  plugins:
    HASS:
      type: hass
      ha_url: http://172.23.1.10:8001/
      token: XXXXXXXXXXXXXXX
http:
  url: http://172.23.1.10:5050/
admin:
api:
hadashboard:

I can paste http://172.23.1.10:8001/ into a browser and HA loads successfully, so I think ha_url is fine. I can also load the AD dashboard at http://172.23.1.10:5050/ successfully.

Any suggestions for what might be wrong?

Try removing the trailing slash from ha_url and url. Everything else in your config looks the same as mine.

And here is my docker run command for your reference:

docker run --name=appdaemon -d -p 5050:5050 --restart=always  -e HA_URL="http://192.168.1.206:8123"   -e TOKEN="MYLONGLIVEDTOKEN" -e DASH_URL="http://192.168.1.45:5050" -v /home/appdaemon:/conf acockburn/appdaemon:latest

Thanks @tjntomas, that was the issue. I actually had two problems trying to set AppDaemon up:

  1. AppDaemon won’t connect to the HTTPS port of your HA instance, so I had to use the local-network-only HTTP port
  2. AppDaemon doesn’t seem to tolerate trailing slashes in the HA URL

It seems to be working now. Thanks a lot.