Suddenly my client will not get a connection from server.
See original GitHub issueI have an app (client && server on separate HEROKU servers)… Its been working perfectly for years. Now all the sudden the connection is intermittent. in v4 the error is 400 in v2 the error is cors… Ive tried almost every cors configuration i can think of.
It looks like the client connect and disconnects several times. sometimes the connection sticks but most of the time it disconnects before the frontend can join a room
It works perfectly with almost any configuration on localhost at all times
Client ==> “socket.io-client”: “^4.4.1”,
this.socket = io(environment.backend, {
withCredentials: true,
extraHeaders: { dash: "abcd" },
});
Server ==> “socket.io”: “^4.4.1”,
this.io = new Server(server, {cors: {
origin: env.frontend_url,
allowedHeaders: ["dash"],
credentials: true
}});
often after a confirmed connection there is the following error
websocket.js:54 WebSocket connection to ‘wss://fornida-api.herokuapp.com/socket.io/?EIO=4&transport=websocket&sid=j64x9KB6m87VHUM4AAAJ’ failed:
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
"Cannot connect the computer to the server" error message ...
Cannot connect the computer to the server because either another software installation is in progress or, the computer has a restart pending.
Read more >How to fix the four biggest problems with failed VPN connections
1: The VPN connection is rejected. If the Windows server-powered VPN is rejecting client connections, the first thing you need to do is...
Read more >How to fix 8 common remote desktop connection problems
First, try to establish a session from a client that has been able to successfully connect in the past. The goal is to...
Read more >What can be the reasons of connection refused errors?
A firewall between the client and server is blocking access (also check local firewalls). After checking for firewalls and that the port is...
Read more >How to Troubleshoot SSH Connectivity Issues
Verify that you can resolve the hostname on your client machine using the system ping command. Using third-party sites like WhatsMyDns.net to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ohabash for the Heroku platform, you can check: https://devcenter.heroku.com/articles/session-affinity
If it’s an HTTP 400 error, it sounds like a “Session ID unknown” error, when some requests reach a different Socket.IO server in a multiple servers setup. Are sticky sessions enabled?
See also: https://socket.io/docs/v4/troubleshooting-connection-issues/