WebSocket Output

Send data over a WebSocket connection.

What it does

WebSocket Output sends the value wired into Message out over a live WebSocket connection. In Server mode it broadcasts to every client that connects to it. In Client mode it connects out to an external WebSocket server at a URL you set. Either mode reports whether a client is connected, whether the last message went out, and any error text.

Send On Change is on by default, so a static value does not resend every frame.

When to use it

ParameterTypeDefault
messageAny
modeString"server"
urlString""
send_on_changeBooleantrue
enabledBooleantrue

Gotchas

Turn Send On Change off to send on every cook even when the value has not changed, for example to keep a heartbeat alive.

Worked example

  1. Add a WebSocket Output node and wire a value into Message.

  2. Leave Mode on Server to broadcast to any client that connects, or switch to Client and enter a URL to push into an existing WebSocket server.

  3. Watch the Connected output to confirm a client is attached, and Sent to see when a message goes out.

  4. If nothing reaches the other end, check the Error output.

See also

WebSocket Input · OSC Output · MQTT Publish · Numbers, signals & audio