On the local server, these settings work
CHAT_WS_SERVER_HOST = '0.0.0.0'
CHAT_WS_SERVER_PORT = 3000
CHAT_WS_SERVER_PROTOCOL = 'ws'
And the chat is working fine, but on Heroku there is an error(Chrome):
WebSocket connection to 'ws://0.0.0.0:41540/jgvnf53ky1m1lxt1vrka9lcnfilwhkrv/Pechkin' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
On Heroku I use such settings:
CHAT_WS_SERVER_HOST = '0.0.0.0'
CHAT_WS_SERVER_PORT = os.environ['PORT'];
CHAT_WS_SERVER_PROTOCOL = 'ws'
Python code
websocket = new WebSocket(base_ws_server_path + '{{ request.session.session_key }}/' + opponent_username);
JS code on client
websocket = new WebSocket(base_ws_server_path + 'jgvnf53ky1m1lxt1vrka9lcnfilwhkrv/' + opponent_username);
Fihish
ws://0.0.0.0:41540/jgvnf53ky1m1lxt1vrka9lcnfilwhkrv/Pechkin
I read that this is a problem because of the certificate (wss \ https), but I don't use him now... or with the wrong IP