websocketbridge.js:183 Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.

2,481 views
Skip to first unread message

djangorobert

unread,
May 23, 2017, 12:56:22 PM5/23/17
to Django users
Hi Im working with django and django channels but seem to be running in to constant road blocks not able to get a websocket conection i working with andrew godwins example on github the "MULTICHAT" example all im trying to do is to get it to work lol in a production envirment but i continue to get errors like this: 


websocketbridge.js:183 Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.

this.send = function (data) { ws.send(data); };

   key: 'send',
    value: function send(msg) {
      this.socket.send(JSON.stringify(msg));
    }
dge.js:118 WebSocket connection to 'ws://www.openchat.us/chat/stream' failed: Error during WebSocket handshake: Invalid status line

var connect = function () { log('connect'); var oldWs = ws; ws = new config.constructor(url, protocols);


WebSocket connection to 'ws://www.openchat.us/chat/stream' failed: WebSocket is closed before the connection is established. (index):170 Disconnected from chat socket

// Helpful debugging webSocketBridge.socket.onopen = function () { console.log("Connected to chat socket"); }; webSocketBridge.socket.onclose = function () { console.log("Disconnected from chat socket"); }


The commands im using in the putty console is : daphne -p{} myproject.asgi:channel_layer
then i open another putty console and enter the command python manage.py runworker

but have continued to run into these problems going on 2 weeks now of this junk I want to use django channels but if the problems continue going to move on with socketio instead.

Thanks for anyone who can help


djangorobert

unread,
May 24, 2017, 1:29:46 PM5/24/17
to Django users
I know get this error: 

(index):48 Connecting to ws://www.openchat.us/chat/stream/
reconnecting-websocket.min.js:1 WebSocket connection to 'ws://www.openchat.us/chat/stream/' failed: Error during WebSocket handshake: Invalid status line
open @ reconnecting-websocket.min.js:1
a @ reconnecting-websocket.min.js:1
(anonymous) @ (index):49
i @ jquery-1.12.2.min.js:2
fireWith @ jquery-1.12.2.min.js:2
ready @ jquery-1.12.2.min.js:2
K @ jquery-1.12.2.min.js:2
(index):164 Disconnected from chat socket
Reply all
Reply to author
Forward
0 new messages