I am trying to get a chat application running on django channels to work with AWS Elastic Beanstalk with a load balancer.
I basically modify the code from https://github.com/jacobian/channels-example to work with an elastic bean stack. I can successfully run it locally with the command
python manage.py runserver
The problem is when I deploy it using Elastic Beanstalk, I get the following error when launching the chat application.
WebSocket connection to 'wss://mydomain.com/test/' failed: Error during WebSocket handshake: Unexpected response code: 200
I have tried the solutions suggested in https://stackoverflow.com/a/3/4129/129 , 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 received an SSL certificate to change the safe listener port to SSL 443, but still get the same error.
I also read Websockets from socket.io on AWS Elastic Beanstalk , but there is no way to configure a proxy server for Django, I think it uses Apache by default.
What am I missing for setting up Elastic Beanstalk to make it work?
Is there a way to change this so that we can start the daphne server with asgi?
django elastic-beanstalk websocket redis django-channels
user3667089
source share