Skip to main content

WebSocketServer Node

Runs a WebSocket server and streams its mono input to every connected client. Audio is buffered and broadcast about every 100 ms as a binary message of raw 32-bit float samples (native byte order, at the graph's sample rate). Messages from clients are ignored. The server starts when the node is created.


Configuration​

port​

Type: Int

Port to listen on. If omitted, a free port is taken from a shared pool (12346 to 12446) and returned to the pool when the node is destroyed; read the port property to find out which one was chosen.


Properties​

Inherits properties from its parents, Node, SwitchboardObject.

port (Read only)​

Type: Int

Port the server is listening on: the configured port, or the one taken from the pool.


Actions​

Inherits actions from its parent, SwitchboardObject.

start​

Starts the server and the periodic broadcast. The server already starts when the node is created, so this is only needed after stop.

Parameters​

None.

Return Value​

None.

stop​

Stops the server and the periodic broadcast.

Parameters​

None.

Return Value​

None.


Events​

This object does not provide any events.