Replies: 1 comment 8 replies
-
Hi! I see you are using HTTPS (
That sounds indeed like a firewall issue or something else getting in the way. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
We have a NodeJS server and ReactJS client communicating via socket.io.

This setup has been working for years. We are suddenly experiencing the following connect_error (without any changes in code):
We are using transport 'polling' that is later upgraded to 'websocket' after the handshake, but in this case the polling requests go into pending state and then timeout.
The issue is only observed on some machines while on the others it is still working fine on localhost.
The same code is also working fine on the QA, Stage and Prod deployment environments.
Furthermore, we have a multi-node setup, therefore, we use the following packages to run our server on multiple CPU cores - cluster, @socket.io/sticky and socket.io-redis (now @socket.io/redis-adapter).
The React app runs on port 3000. The NodeJS app includes an HTTP server running on port 8090 and the websocket server running on port 8092.
Current versions:
OS: Windows 11
NodeJS: 14.16
socket.io: 3.1.2
@socket.io/sticky: 1.0.1
@socket.io/redis: 6.0.1
redis: 3.0.2
Since @socket.io/redis is now renamed to @socket.io/redis-adapter, we upgraded it from 6.0.1 to 8.2.1 and also migrated from socket.io 3.1.2 and 4.6.1. We have also tried upgrading the other related packages but we still see the same error.
Disabling the antivirus and firewall on the windows machine hasn't helped either.
However, we have observed that if we use transport 'websocket' instead of 'polling', the error goes away.
Based on Chrome network tab, network port monitoring and debug logs of socket.io, we have observed that when long polling starts, 1-2 polling requests are reaching the server, while the others are not.
Browser:

Port traffic:

socket.io logs:
logs.txt
Code Snippets:
Client:
Server:
Master:
Worker:
What could be the issue with polling + websocket?
Kindly assist.
Thanks
Tehnaz
Beta Was this translation helpful? Give feedback.
All reactions