Manage WebSocket Connections

The Manage WebSocket Connections task configures the gateway to communicate with WebSocket clients and servers for both inbound and outbound messages. WebSocket technology provides bi-directional, full-duplex communications channels over a single TCP connection and reduces the time spent establishing connections for each request.
gateway94
The
Manage WebSocket Connections
task configures the
Layer7 API Gateway
to communicate with WebSocket clients and servers for both inbound and outbound messages. WebSocket technology provides bi-directional, full-duplex communications channels over a single TCP connection and reduces the time spent establishing connections for each request.
For greater flexibility, you can specify a policy that executes upon the initial connection to the Gateway, when messages are received by the client, and/or when messages are received by the back-end server. These are known as the Connection Policy, Inbound Policy, and Outbound Policy, respectively. If you intend to specify such policies, ensure they have been published ahead of time using the Publish Web API task.
The Manage WebSocket Connections tasks supports WebSocket compression and will use it if the client or server also supports compression.
Use the Manage Transport Properties/Headers Assertion to add new headers. However be aware that you you cannot remove or replace
existing
WebSocket request headers. You can use the
Add or Replace
or
Remove
options only for headers that were added by the Manage Transport Properties/Headers Assertion.
To configure WebSocket connections:
  1. In the Policy Manager, select
    Tasks >
    Extensions and Add-Ons > Manage WebSocket Connections
    .
  2. Double-click an existing connection to edit the WebSocket Connection Properties, or click
    Create
    to add a new connection.
Configure the following cluster properties when your Gateway queue is full so that WebSocket can accept new connection requests:
  • websocket.forward.ping
  • websocket.outbound.max.connections.per.destination
  • websocket.outbound.max.requests.queued.per.destination
  • websocket.outbound.client.connect.request.timeout