DEV Community

loading...

Discussion on: How to Build a Real-time Chat App With NodeJS, Socket.IO, and MongoDB

Collapse
g_mann43 profile image
Gavin

Would you not do presence by holding an array of users on server side and upon connection add the user to the array and broadcast to everyone/room...and on disconnect remove the user from the array and broadcast the disconnection status ?