Skip to main content

Module upgrade

Module upgrade 

Source
Expand description

Upgraded connections (WebSocket) relayed to a backend (moved from the Gateway API controller in 18.21.0; config proxy routes use it too). Upgraded connections (WebSocket) through a proxy (a Gateway API route, or a config-file type = "proxy" route since 18.21.0): the request goes to the backend over its own connection; a 101 hands the client’s connection to a byte relay with the backend, anything else is answered as a normal response.

Functions§

forward
Forward an upgrade request to ip:port.
is_upgrade
Whether the request asks to switch protocols (Connection: upgrade and an Upgrade header).
request_head
The request head as sent to the backend: the client’s headers (with Host = host) plus X-Forwarded-For and, unless the client sent one, X-Forwarded-Host (the client’s own Host).