Events

Events
onConnect
onMessage

onConnect

Fires on socket connection.

Parameters: Socket

Example:

function onConnect(socket) {
  // Do something...
}

module.exports = { onConnect };

onMessage

Fires on message receive.

Parameters: Message

Example:

function onMessage(message) {
  // Do something...
}

module.exports = { onMessage };