chevron_right
chevron_right
chevron_right
chevron_right
chevron_right
chevron_right
chevron_right
chevron_right

clients is a member of WebSocketController. It contains all the methods to interact with websocket connected clients.


emit


emit an event to all connected clients

clients.emit("event name", data)


current


get current connected client, which can be used to emit an event to current client

clients.current.emit("event name", data)


except_me


except_me will return another clients object, which won't have caller client. It can be used to emit event to all connected clients except the caller.

clients.except_me.emit("event name", data)


groups


groups can be used to group no of clients. Read more about groups.