WebSocket
The PRX gateway provides a WebSocket endpoint for real-time, bidirectional communication with agent sessions. This enables streaming responses, live tool execution updates, and interactive conversations.
Connection
Connect to the WebSocket endpoint at:
ws://127.0.0.1:3120/ws/sessions/:idMessage Protocol
Messages are exchanged as JSON objects with a type field:
Client to Server
message-- send a user messagecancel-- cancel the current agent operationping-- keepalive ping
Server to Client
token-- streaming response tokentool_call-- agent is calling a tooltool_result-- tool execution completeddone-- agent response completeerror-- error occurredpong-- keepalive response
Configuration
toml
[gateway.websocket]
max_connections = 100
ping_interval_secs = 30
max_message_size_kb = 1024