I am trying to get a chat app powered by django channels to work on AWS Elastic Beanstalk with a load balancer.
I am basically modifying the code from https://github.com/jacobian/channels-example to work with Elastic Beanstalk. I am able to successfully run it locally on with the command
python manage.py runserver
The problem is when I deploy it with Elastic Beanstalk, I get the following error when the chat app is launched
WebSocket connection to 'wss://mydomain.com/test/' failed: Error
during WebSocket handshake: Unexpected response code: 200
I tried solutions proposed at https://mcmap.net/q/400295/-i-get-a-status-200-when-connecting-to-the-websocket-but-it-is-an-error but it just showed a different error code
WebSocket connection to 'wss://mydomain.com/test/websocket' failed:
Error during WebSocket handshake: Unexpected response code: 404
I also already changed the load balancer listener port to TCP 80 and obtained a SSL certificate to change the secure listener port to SSL 443 but still get the same error.
I also read Websockets with socket.io on AWS Elastic Beanstalk but there isn't an option to configure the proxy server for Django, I think it is using Apache by default.
What am I missing for the configuration of Elastic Beanstalk to make it work?
Is there any way to change this so we can run daphne server with asgi?
venv/bin/daphne app.asgi:channel_layer
) and workers (python manage.py runwoker
) in order to get things working. I can post my supervisord.conf in the answers if you want, but I'm not sure how things work on Elastic Beanstalk. – Hovercraft