Skip to main content

Module websocket

Module websocket 

Source
Expand description

WebSocket upgrade detection and bidirectional proxying.

When a client sends a WebSocket upgrade request (Connection: Upgrade + Upgrade: websocket), this module forwards the upgrade to the upstream backend and then establishes a bidirectional byte-copy between the client and upstream, effectively tunnelling the WebSocket frames without interpreting them.

Functionsยง

is_websocket_upgrade
Check whether an incoming request is a WebSocket upgrade.
proxy_websocket
Proxy a WebSocket upgrade request to the given upstream address.