socketio / socket.io-redis-emitter

The Socket.IO Redis emitter, allowing to communicate with a group of Socket.IO servers from another Node.js process.
https://socket.io/docs/v4/redis-adapter/
MIT License
721 stars 121 forks source link

how it work? #60

Closed myfreax closed 7 years ago

myfreax commented 7 years ago

Three questions

this lib how it work?

Redis is required?

Error: Redis connection to 127.0.0.1:12345 failed - connect ECONNREFUSED 127.0.0.1:12345
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:14)

The 127.0.0.1:12345 is socket.io listen port

Why require Redis?

darrachequesne commented 7 years ago

socket.io-emitter allow you to broadcast packets to other socket.io servers through Redis pub/sub mechanism.

emitter -----> Redis |----> server |----> client
                     |             |----> client
                     |             | ...
                     |----> server |----> client
                                   |----> client
                                   | ...
myfreax commented 7 years ago

3q