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 ID | websocket_client_transport |
| Selected by | app_transport = "websocket_client_transport" |
| Platforms | Linux, Windows, Android |
| License | Premium |
WebSocket client message-based transport
Connection Configuration:
- Server URL: WebSocket server address
ws://host:port/path- Standard WebSocket connectionwss://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
- Format: One header per line
Proxy (optional):
- Leave empty for a direct connection. Supported proxy URL formats:
http://[user:pass@]host:port- HTTP CONNECT tunnelsocks5://[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.
| Setting | Key | Type | Default | Notes |
|---|---|---|---|---|
| WebSocket URL | websocket_client_transport_url | Text | "ws://localhost:8080" | Required |
| Subprotocols | websocket_client_transport_subprotocols | Text | "" | |
| Connection Timeout (seconds) | websocket_client_transport_timeout | Text | "30" | |
| Custom Headers | websocket_client_transport_headers | Multiline text | see below | |
| Proxy URL (optional) | websocket_client_transport_proxy_url | Text (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):
| Value | Label |
|---|---|
"" | 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": ""
}
}