I am trying to implement private chat functions using the sails.js framework and I am having problems trying to send a message to a specific user.
Currently, I have achieved private communication by sending messages to a specific socket.id using socket.io .socket(socket.id).emit(event,message) , but the problem with this approach is that every time the user opens a new tab, new socket.id, for this new connection.
And my question is: does sails.js do a way to emit events (using socket.io) for a specific user session instead of a bunch of socket identifiers? is this possible with these technologies?
Therefore, I can send an event only once and make sure that it is received on all the tabs in which the chat application is now open.
Thanks in advance.
source share