Command Type
Command Type ID: 1Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| url | string | WebSocket server URL | Yes |
| ciphers | string | TLS cipher suites override | No |
| headers | object | Custom HTTP headers for the WebSocket handshake | No |
| heartbeatIntervalMs | number | Interval in ms to re-publish the current result as a heartbeat | No |
| onClose | Array of Command | Commands to run when the connection closes | No |
| onConnect | Array of Command | Commands to run once the connection is established | No |
| onError | Array of Command | Commands to run when a socket error occurs | No |
| onInterval | WebSocketV2OnInterval | Commands to run on a recurring interval while connected | No |
| onMessage | Array of Command | Commands to run for each incoming message (raw message placed in data) | No |
| protocol | string | Protocol variant: "native", "signalr", "signalr-legacy", "socketio" | No |
| proxy | ProxySettings | Proxy settings for the connection | No |
| signalr | WebSocketV2SignalRSettings | Configuration for SignalR protocol | No |
| socketio | WebSocketV2SocketIOSettings | Configuration for Socket.IO protocol | No |
| stopOn | WebSocketV2StopOn | Conditions that trigger an automatic connection stop | No |
WebSocketV2OnInterval
| Field | Type | Description | Required |
|---|---|---|---|
| intervalMs | number | Interval between command executions in milliseconds | Yes |
| commands | Array of Command | Commands to execute on each tick | Yes |
WebSocketV2SignalRSettings
| Field | Type | Description | Required |
|---|---|---|---|
| methods | Array of string | SignalR hub methods to subscribe to | Yes |
| skipNegotiation | boolean | Skip the SignalR negotiation handshake | No |
| transport | string | Transport: "webSockets", "serverSentEvents", "longPolling" | No |
WebSocketV2SocketIOSettings
| Field | Type | Description | Required |
|---|---|---|---|
| events | Array of string | Socket.IO events to subscribe to | Yes |
| path | string | Socket.IO server path | No |
WebSocketV2StopOn
| Field | Type | Description |
|---|---|---|
| inactive | boolean | Stop when the connection becomes inactive |
| itemDeleted | boolean | Stop when the associated item is deleted |
| serverClose | boolean | Stop when the server closes the connection |
Usage Examples
Native WebSocket with onMessage Hook
SignalR Connection
With Heartbeat Interval
Related Commands
- WebSocket V2 Send - Send within onConnect/onMessage hooks
- Decode (WS V2) - Decode compressed payloads
- WebSocket V2 Close - Terminate the connection