Skip to content

Emit data only to local users when using redis adapter #5186

Answered by darrachequesne
brako asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! You can use the local broadcast modifier:

io.local.emit("hello");

Reference: https://socket.io/docs/v4/server-api/#flag-local

The event will only be forwarded to the clients connected to the current server.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@brako
Comment options

Answer selected by brako
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants