Skip to main content

WebSocket Client Transport

Connects to a WebSocket server at a ws:// or wss:// URL. Each frame is one message, so no codec is needed. Text frames arrive as text messages and binary frames as binary ones; when sending, binary payloads go out as binary frames and everything else as text. Pings are answered automatically.

A Proxy URL routes the connection through an HTTP or SOCKS5 proxy. If the server closes the connection, CycBox reconnects while the engine runs.

Configuration reference​

Config IDwebsocket_client_transport
Selected byapp_transport = "websocket_client_transport"
PlatformsLinux, Windows, Android
LicensePremium

WebSocket client message-based transport

Connection Configuration:

  • Server URL: WebSocket server address
    • ws://host:port/path - Standard WebSocket connection
    • wss://host:port/path - Encrypted WebSocket connection (TLS)
    • Examples: ws://localhost:8080/ws, wss://example.com/socket

Advanced Options:

  • Subprotocols: Comma-separated list of WebSocket subprotocols
    • Used to negotiate application-level protocols (e.g., "chat", "mqtt")
    • Server will select one of the supported subprotocols
  • Connection Timeout: Connection timeout in seconds
  • Custom Headers: Add custom HTTP headers to the handshake request
    • Format: One header per line Key: Value
    • Lines starting with # are ignored
    • Common use for authentication: Authorization: Bearer token123

Proxy (optional):

  • Leave empty for a direct connection. Supported proxy URL formats:
    • http://[user:pass@]host:port - HTTP CONNECT tunnel
    • socks5://[user:pass@]host:port - SOCKS5 (target hostname resolved locally)
    • socks5h://[user:pass@]host:port - SOCKS5 (target hostname resolved by the proxy)
  • For wss:// targets, TLS is negotiated over the proxied connection.
SettingKeyTypeDefaultNotes
WebSocket URLwebsocket_client_transport_urlText"ws://localhost:8080"Required
Subprotocolswebsocket_client_transport_subprotocolsText""
Connection Timeout (seconds)websocket_client_transport_timeoutText"30"
Custom Headerswebsocket_client_transport_headersMultiline textsee below
Proxy URL (optional)websocket_client_transport_proxy_urlText (with presets)""

Setting details​

Custom Headers​

Default:

# One header per line in format 'Key: Value'. Lines starting with # are ignored. Example:
# X-API-Key: your-api-key

Proxy URL (optional)​

Presets (any other value can be entered):

ValueLabel
""No proxy
"http://proxy.example.com:8080"HTTP
"http://user:pass@proxy.example.com:8080"HTTP with auth
"socks5://proxy.example.com:1080"SOCKS5
"socks5://user:pass@proxy.example.com:1080"SOCKS5 with auth
"socks5h://proxy.example.com:1080"SOCKS5h (remote DNS)

Example config​

Default values as they appear in a saved configuration (for example the JSON block at the end of a cycbox/examples/*.lua file). Settings detected at runtime are omitted.

{
"app": {
"app_transport": "websocket_client_transport"
},
"websocket_client_transport": {
"websocket_client_transport_url": "ws://localhost:8080",
"websocket_client_transport_subprotocols": "",
"websocket_client_transport_timeout": "30",
"websocket_client_transport_headers": "# One header per line in format 'Key: Value'. Lines starting with # are ignored. Example:\n# X-API-Key: your-api-key",
"websocket_client_transport_proxy_url": ""
}
}