adonis-websocket
adonis-websocket copied to clipboard
Count subscribe Client
It is possible that we can count client in a room
Ex. We have Chat Room with Different Topic And Many Clients subscribe Different Topic
When Client subscribe Any Topic then Count subscribed Client
it is possible
At the top of your socket.js or WS Controller
var user_count = 0;
when a user joins or disconnects
user_count++ or user_count--
and you can emit that variable
socket.emit('users', user_count)