Saturday, May 20, 2017

Re: Django Channels Error: WebSocket connection to 'ws://openchat.us:24711/' failed: WebSocket is closed before the connection is established.

hi james im going off of andrew godwins django channels example on github the multi chat example and using Webfactions hosting services. 
im  getting the error of the websocket being closed
I know your saying to maybe chaning it to wss instead of ws do you mean to change it in the javascript that is in the django channels github for multichat js file ?

On Friday, May 19, 2017 at 11:21:33 PM UTC-5, James Schneider wrote:


On May 19, 2017 8:02 PM, "djangorobert" <djangoc...@gmail.com> wrote:

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

thats part of what the error points me to in google tools: 




(index):182 Disconnected from chat socket
VM170 websocketbridge.js:118 WebSocket connection to 'ws://www.openchat.us/chat/stream/' failed: Error during WebSocket handshake: Invalid status line
connect @ VM170 websocketbridge.js:118
(index):182 Disconnected from chat socket
On Friday, May 19, 2017 at 11:53:37 AM UTC-5, 


Not sure if Web sockets have this problem, but I've seen invalid handshake errors come about when one side is using HTTPS and the other is just using HTTP. Perhaps connect to wss:// instead of ws://? I think that's the secure protocol for web sockets.

-James

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c4eb889f-c0da-4f6c-9f08-8bfee0ef841d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment