Skip to main content
The Web Socket Connect command (Command Type: 1) establishes a connection to a WebSocket server. Supports proxy settings, authentication, custom headers, and cipher suites.

Command Type

Command Type ID: 1

Parameters

ParameterTypeDescriptionRequired
urlstringWebSocket server URLYes
timeoutnumberTimeout for the command in millisecondsYes
ciphersstringCipher suites override (optional)No
headersobjectCustom headers for the WebSocket handshakeNo
protocolstringWebSocket sub-protocolNo
proxyProxySettingsProxy settingsNo

ProxySettings

FieldTypeDescriptionRequired
hoststringProxy server hostname or IPYes
portstringProxy server portYes
protocolstringProxy protocol (e.g., http)Yes
authobjectProxy authentication credentialsNo
linkLinkLink proxy configurationNo

Usage Examples

Basic Connection

{
  "command": "websocket-connect",
  "params": {
    "url": "wss://stream.example.com/feed",
    "timeout": 30000
  }
}

Connection with Headers

{
  "command": "websocket-connect",
  "params": {
    "url": "wss://stream.example.com/feed",
    "timeout": 30000,
    "headers": {
      "Authorization": "Bearer %{API_TOKEN}",
      "Origin": "https://example.com"
    }
  }
}

Connection via Proxy

{
  "command": "websocket-connect",
  "params": {
    "url": "wss://stream.example.com/feed",
    "timeout": 30000,
    "proxy": {
      "host": "proxy.example.com",
      "port": "8080",
      "protocol": "http"
    }
  }
}