- policyRef:
name: websocket-connection-limit-flex
config:
maximumConnections: <integer> // REQUIRED, minimum 1
WebSocket Connection Limit Policy
Policy Name |
WebSocket Connection Limit |
Summary |
Limits the number of simultaneous WebSocket connections that each API instance allows |
Category |
Quality of Service |
First Omni Gateway version available |
v1.13.0 |
Returned status codes |
429 - |
Summary
The WebSocket Connection Limit policy tracks the number of active WebSocket connections for a specific API instance. Omni Gateway identifies these requests by the Upgrade: websocket header and ignores standard HTTP traffic. The WebSocket connection limit is distributed across Omni replicas.
When a WebSocket upgrade request arrives, Omni Gateway increments the counter to reserve capacity before forwarding the handshake to the upstream service. If the upstream service doesn’t return a 101 Switching Protocols response, Omni Gateway releases the reservation. After a successful WebSocket connection closes, Omni Gateway decrements the counter.
If the counter reaches the maximumConnections limit, Omni Gateway rejects the upgrade request with a 429 error code.
Configuring Policy Parameters
Omni Gateway Local Mode
When you apply the policy via declarative configuration files, Refer to the following policy definition and table of parameters:
| Parameter | Required | Default Value | Description |
|---|---|---|---|
|
Yes |
|
Maximum number of simultaneous WebSocket connections allowed for the API instance. The value must be an integer of 1 or greater. |



