0

i'm experimenting node.js and made a cool chat application followed by this article using socet.io!

Then i have added a authentication system using Passport.Js into my test site.

How i would do this: among many users, user X want to send some kinds of notification to user Y not to other users!!

I am using the emit() function with a custom event called notifybuzz but when a user send a notification it goes to all accounts!!

Jess Ams.
  • 41
  • 1
  • 3

1 Answers1

0

This article mentions that you will need to use the form socket.broadcast.emit('hi'); to send to limited recipients. the challenge will be to keep track of your socket connections, and relate user information to them. Once that's done, you'll know exactly which socket to send your message over.

Best of luck!