WebSocket

Websocket handling.

close()

Closes an existing websocket connection.

ping(url[, protocol])

Pings to an existing websocket connection.

Arguments:
url (String)

Url (may start with 'wss://', 'ws://' or ''

protocol (String)

No-use yet

Returns: WebSocket | null

Websocket connection or null on failure

send(message)

Send an message over a websocket connection.

Arguments:
message

(String | ArrayBuffer): Message to be send

Returns: Integer | null

0 on success, or null if failed.

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!