socket.iosocket.io-redis

Force client disconnect by socket id


I'd like to force client disconnect by socket id using socket.io-redis. I tried a lot of research in google, but methods mentioned in old topics does not work.

Let's say, I'm making clustered application and my code at the moment runs at cluster1 instance (also I have access to all connected client's socket ids), but the client is connected to cluster2 instance. How can I force disconnect to that client by socket id only?


Solution

  • I've implemented it by myself and pulled in the socket.io-redis repo. Method name is remoteDisconnect.