WebSocketServer

WebSocket Server handling.

new WebSocketServer(host[, protocol])

Constructor for a WebSocket listener.

Arguments:
host (String)

hostname or ws:// url

protocol (String)

No-use yet

Event: onmessage(client, event)

Event triggered when a message arrives.

Parameters:
client (WebSocketServerClient)

The connected client

event (Object)

event object with key data

Event: onopen(client)

Event triggered when a client connects.

Parameters:
client (WebSocketServerClient)

The connected client


Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!