-
Notifications
You must be signed in to change notification settings - Fork 488
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
Question: doesn't seem to work, though all set up according to the docs #16
Comments
Hi, You need to use sticky sessions. Refer to The problem is since there are multiple listeners on the same port, each I am currently using Nginx as a forwarding proxy for multiple Socket.IO I will reply back a detailed answer when I get to my PC tomorrow. Regards,
|
Also, can you run the server using debug as: |
@shantanuthatte I thought that this redis thing does the same as |
@suprMax Socket.IO client first connects to the server with a regular HTTP request and gets a session key. Say this was given by Worker 1. Now it makes a XHR Polling request. This can land up at any worker and they will not have the session id. This will result in failure at client and it will reconnect. To avoid this you need a shared variable that holds all the client information and even with redis pub/sub there are times (when redis hasn't yet sent out the pub, and the XHR Request arrives) when using external services to synchronize would fail. The redis adapter is primarily used to send messages to multiple clients connected across multiple workers. For details run |
@shantanuthatte thanks for your reply, but I'm still confused. From what you said I take it that redis adapter will use redis to store sessions and therefore using clusterer shouldn't break socket anymore. But it does. So the question remains, what am I doing wrong? :D I know that redis connection is OK and redis is working... |
Ok, I re-read documentation and it seems that what I want is indeed sticky session. Unfortunately it's not maintained anymore, and I wanted a sort of quick drop in solution for now. I think I will use nginx load balancing for this project and sort out that clustering thing later. Thanks for your help! |
Hi!
I have the following setup:
With only 1 fork running it works perfectly, though socket seems to use polling instead of websocket as a transport.
Connection to redis is successful:
When I start 4 forks, socket can't finish handshakes anymore. What am I doing wrong?
The text was updated successfully, but these errors were encountered: