use socketio and redis on multiple servers

463 views Asked by At

I'm trying to use socketio on multiple servers, during a whole week I tried different solution, on different platform and all of them are not working.

for my project I'm using nginx load balancing with iphash to keep the clients on the same server, and to broadcast to all sockets I'm using redis socketio adapter.

I tried also these projets in order to see if its working and understand how its working, but this supposed ready to use project are not working too.

https://github.com/h4t0n/socket.io-redis-appsample

and this one

https://github.com/evilstudios/chat-example-cluster

I tried with redis on windows and on linux but no difference.

I read on different questions that we need to use "transports: ['websocket']", some persons said it need to be done on the clients some other on the clients and servers, I tried both solution and its not working.

I'm not getting an error or warnings, the events are simply not sent to the sockets on the other servers.

1

There are 1 answers

0
Bilel Boulifa On

look it was coming from incompatibility between version or something like that. I updated socket.io and its working

I started the development of my app around 6 months ago at that time the last version was 1.4.8 so I'm using this version now I updated it to 1.7.2 and its working.

concerning socket.io-redis I installed it just this week so I was using the last version 2.0.1

look like between 1.4.8 and 1.7.2 something important changed.