in your broadcast method, you're simply doing a forEach over every socket and emitting directly to the socket. I think when you do that you're not allowing for the fact that there may be multiple nodes (and thus sockets that should be broadcast to that are not in the same process or on the same machine).
I think you can fix this by doing io.sockets.emit(...) to emit to all sockets and not just the in-process ones.
Note: I haven't tried this yet but its the impression I get when I read the code; and I'm unable to get multi-instance working with socket.io-redis.
in your broadcast method, you're simply doing a
forEach
over every socket and emitting directly to the socket. I think when you do that you're not allowing for the fact that there may be multiple nodes (and thus sockets that should be broadcast to that are not in the same process or on the same machine).I think you can fix this by doing
io.sockets.emit(...)
to emit to all sockets and not just the in-process ones.Note: I haven't tried this yet but its the impression I get when I read the code; and I'm unable to get multi-instance working with
socket.io-redis
.