Listening to a socket with socket.io-redis module

With the socket.io-redis we can easily send an emit/broadcast message using saved-socket-id .

 io.to(socket-id-from-redis).emit('serverEvent', "some message"); 

On the other hand, the best way to listen on a socket without any additional / external redis sub / pub clients.

When I initialized the socket-io.redis , I configured the subscriber with return_buffers: true , I think the module solves it behind the scenes, but I could not find any examples.

Is there a smooth way to do this with socket.io-redis ? Or should each cluster socket listener post messages, and should I manually subscribe to other clusters?

Thanks.

+5
source share

All Articles