Events

The client instance emits events that you can listen to, in particular you should use the 'connection' event to detect when the clients are connected and ready for communication.

connection

Fired when both peers are connected and ready for communication.

message

(message: Buffer) => void

Fired when a message was sent using the "send" method.

Last updated