Answer the question
In order to leave comments, you need to log in
How to send data to a specific user via socket.io?
Hello everyone
In general, there is a game where users do various actions.
All actions are processed and data is transferred to the database of users, but I don’t know how to transfer exactly its data from the database through sockets and so that it displays the changes, if any
. need to show these changes in
real time Authorization done by jwt + passport.js
Please help
Answer the question
In order to leave comments, you need to log in
We store in memory (or cache) a "table" with connection and user associations. When connected, the table is replenished, when disconnected, the necessary records are deleted accordingly. When an event occurs, we look for all its connections and for each helmet the same message.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question