websocket_config
section in your upstream configuration.
Option | Type | Description | Default |
---|---|---|---|
enable_direct_communication | boolean | When true, each client connection gets its own dedicated connection to the upstream service. When false, connections are multiplexed. | false |
return_error_details | boolean | When true, detailed error messages are returned to clients. | false |
ping_period | string | The interval for sending ping messages to keep connections alive (e.g., ”30s”). | ”30s” |
pong_wait | string | The timeout for receiving pong responses (e.g., “2m”). | ”45s” |
handshake_timeout | string | The timeout for the initial WebSocket handshake (e.g., “5s”). | “5s” |
read_buffer_size | integer | The size of the read buffer in bytes. | 4096 |
write_buffer_size | integer | The size of the write buffer in bytes. | 4096 |
Option | Type | Description | Default |
---|---|---|---|
passive | boolean | When true, enables passive health checks that monitor actual traffic. | false |
path | string | The path to use for active health checks. | "" |
headers | object | Headers to include in health check requests. | {} |
threshold | integer | Number of failures before marking a target as unhealthy. | 3 |
interval | integer | Time in seconds before resetting the failure count. | 60 |
enable_direct_communication: true
), each client connection gets its own dedicated connection to the upstream service. This mode is useful when:
enable_direct_communication: false
), TrustGate maintains a pool of connections to upstream services and routes messages from multiple clients through these shared connections. This mode is useful when:
/ws/
to be properly identified by TrustGate. For example:
return_error_details
is enabled, TrustGate will send detailed error messages to clients when issues occur, such as:
ping_period
, pong_wait
, and handshake_timeout
based on your application’s needs.max_connections
in your global WebSocket configuration to prevent resource exhaustion.