socket.io
socket.io copied to clipboard
v4 RemoteSocket unsupport to/in function
Is your feature request related to a problem? Please describe. v4 RemoteSocket unsupport to/in function send to everyone in the room except sender when use the controller(KOA or exressjs) ,
Describe the solution you'd like RemoteSocket support to/in function .
I'm in the same situation. 🤔 I surfed across the code and the only thing would be to be able to somehow tell other servers to search for the socket with a given ID and not emit the message to it.
I think you should be able to achieve what you want with except():
io.except(socket.id).emit(/* ... */);
io.to("room1").except(socket.id).emit(/* ... */);
Documentation: https://socket.io/docs/v4/server-api/#namespace-except-rooms