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§
- Proxy
Target - Parsed components of a forward proxy URL.
- Proxy
Url - Validated HTTP or HTTPS proxy URL.
- WsTarget
- Parsed components of a target WebSocket URL needed by the proxy hop.
Enums§
- Proxied
Stream - Stream produced by
tunnel_via_proxywhen the upstream isws://(no upstream TLS, but the proxy hop itself may have been TLS-protected). - Proxy
Kind - Outcome of parsing a proxy URL prior to opening a tunnel.
Functions§
- tunnel_
via_ proxy - Establish a tunneled connection through
proxyto the WebSockettarget.