-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it supposed to work with socket.io ? #81
Comments
Hey, As you use multiple instances of the same script, socketio doesn't know how to handle proper routes to maintain the same connection between all instances. You must configure properly Socket.io as explained here : https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO
Cheers |
This isn't working, I have an app that used socket.io 0.9.x instanciated as it is said in the examples, it doesn't work, so I updated the socket.io to version 1.0.x and I add the "passport.socketio" version 3.1.x to have session support, again, doesn't work even following the example as described on socket.io and as described on passport.socketio readme: https://github.com/jfromaniello/passport.socketio Both versions and implementations of socket.io worked great on a single instance, but when I used more than one instance the communication failed 99% of the time. the main difference between version 0.9.x and version 1.0.x is I actually receive an error from the client console (some times)
So, there is something happening between socket.io and pm2 that should be reviewed. |
👍 I have the same problems. |
Any news about this problem? I have the same, if I start only one instance with PM2, my app works perfectly, but if I start more than 1 instance, the comunications crash, i see the error "Unable to connect Socket.IO client not handshaken". |
I have the same problem too. At first I thought that something is wrong with my nginx config or socket.io error. Now it proves to be the |
For the record I was wrong about the initial issue. Node.js 0.10 cluster mode should distribute its queries to multiple processes, and at the time it didn't in my case, 0.12 changes that (good explanation there), but it seems PM2 did it. PM2 doesn't do sticky connections (which is not his job, neither cluster's) so you have to use an adapter to store your sessions such as |
@Marsup ,thank you for your explanation! I'll give it a try following your suggestion! |
Hi,
I'm having problems with
socket.io
(which is using websocket transport) since I replacedcluster
withpm2
.It needs several attempts to maintain a stable connection, first few connections end prematurely with sometimes a few packets sent, then stabilize.
Chrome's frame log simply shows a
Connection Close Frame (Opcode 8, mask)
not much to see.Server side socket.io logs show :
Am I the only one seeing this ?
I'm using node 0.8.25 and socket.io 0.9.16.
The text was updated successfully, but these errors were encountered: