WebSockets
The websockets block activates support for WebSocket connections in Couper.
| Block name | Context | Label |
|---|---|---|
websockets | proxy | no label |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
add_request_headers | object | - | Key/value pairs to add as request headers in the upstream request. |
add_response_headers | object | - | Key/value pairs to add as response headers in the client response. |
remove_request_headers | tuple (string) | [] | List of names to remove headers from the upstream request. |
remove_response_headers | tuple (string) | [] | List of names to remove headers from the client response. |
set_request_headers | object | - | Key/value pairs to set as request headers in the upstream request. |
set_response_headers | object | - | Key/value pairs to set as response headers in the client response. |
timeout | string | - | The total deadline duration a WebSocket connection has to exist. |
Duration
Values of type duration are provided as number string followed by a unit listed below.
Example: timeout = "300s"
| Duration units | Description |
|---|---|
ns | nanoseconds |
us (or ยตs) | microseconds |
ms | milliseconds |
s | seconds |
m | minutes |
h | hours |