Open dmonn opened 5 years ago
Can you probably try using a newer version of websockets lib ? Seems to be similar to this issue: https://github.com/django/channels/issues/549
Let's try!
Note @delneg, the upgrade worked, but the issue still seems to persist. I'm not sure about how to locally reproduce this though. It seems to happen in restrictive corporate environments.
Hello again, what do you mean by 'upgrade worked' ? Please provide more details. Also, you could try to implement re-connection by handling 'connection reset' events in javascript and estabilishing a new websocket connection.
The upgrade of websockets didn't make any problems. I'm already doing reconnects with https://github.com/joewalnes/reconnecting-websocket.
Again, this only seems to occur in corporate networks.
Hi everyone, I am also facing WebSocket connection problem since last couple of days. Error Description "_websocket.js:18 WebSocket connection to 'ws://127.0.0.1:8000/ws' failed: Error in connection establishment: net::ERR_CONNECTIONREFUSED"
Browser Console Error line Number 18, (connect @ websocket.js:18) contains following code
const path = 'ws://127.0.0.1:8000/ws'; this.socketRef = new WebSocket(path); this.socketRef.onopen = () => { console.log('WebSocket open'); };
socketRef.onclose @ websocket.js:33
``
websocket.js:29 undefined
websocket.js:32 WebSocket closed let's reopen
32Chat.js:27 wait for connection...
Detail Django version : 2.2 Front-end with react Using Parceljs
Websocket was working fine with Bootstrap and Django Channels, I am trying to develop one to one chat application with React front-end and Python Backend, When I tried to implement the WebSocket in react then it is giving me above mentioned error.
What I have tried Django Channels Issue(549)
I am new to Websocket and React, Any help will be appreciated.
I have solved the above error, actually there was my mistake, I forgot to run both servers(Backend: [python manage.py runserver], and frontend react [npm start]).
Therefore, make sure we have both servers running.
Description
I have django-private-chat deployed in production. Users sent me feedback that they get the following error sometimes (it seems to happen in corporate networks only)
WebSocket connection to XY failed: Error in connection establishment: net::ERR_CONNECTION_RESET
.The chat works fine in 90% of the cases, but this error seems to come up from time to time. Chat is embedded in an iframe (same domain), this could add to the problem.
What I Did
Made sure the chat server is running, tested the chat in my home network - seems to work fine.
Users report:
WebSocket connection to XY failed: Error in connection establishment: net::ERR_CONNECTION_RESET
.