Answer the question
In order to leave comments, you need to log in
How to check user is online or not Websocket?
When connecting, I assign an id to each user ws.onclient=userId;
. How can I check if the user is online or not? If not online return for example not online.
wss.clients.forEach(function each(client) {
if (client.onclient === userId) {
console.log('Онлаин')
}
});
Answer the question
In order to leave comments, you need to log in
Client event listener: network, batch activity, UI timers in batches.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question