DEV Community


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

g_mann43 profile image

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 ?