Skip to main content

Module proxy

Module proxy 

Source
Expand description

HTTP CONNECT tunneling for outbound WebSocket connections.

HTTP and HTTPS proxy URLs are supported. An HTTPS proxy adds TLS to the proxy hop; a wss target adds a separate TLS session after the tunnel is established. URL user information becomes Basic proxy authentication, and credential-bearing values are redacted from Debug output.

The tunnel accepts only a 2xx response and bounds response headers before parsing. It returns a stream positioned for the WebSocket handshake rather than performing that handshake itself.

SOCKS URLs are recognized but not tunneled: the client logs a warning and connects directly. Both transport backends tunnel through the same ProxiedStream, which implements the IO traits over every tunnel shape so each backend runs its own handshake over the finished stream.

Structs§

ProxyTarget
Parsed components of a forward proxy URL.
ProxyUrl
Validated HTTP or HTTPS proxy URL.
WsTarget
Parsed components of a target WebSocket URL needed by the proxy hop.

Enums§

ProxiedStream
Stream produced by tunnel_via_proxy when the upstream is ws:// (no upstream TLS, but the proxy hop itself may have been TLS-protected).
ProxyKind
Outcome of parsing a proxy URL prior to opening a tunnel.

Functions§

tunnel_via_proxy
Establish a tunneled connection through proxy to the WebSocket target.