Answer the question
In order to leave comments, you need to log in
How to display a list of users who are online on the site?
Hello!
I make a chat on nodejs + socket, I use passportjs for authorization. Tell me how to implement the output of a list of unique users who have visited the site and are online. I need to take into account that the user can log in and out from different devices, thereby:
user = {};
socket.on('connect', function() {
user++
});
socket.on('disconnect', function() {
user--
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question