Skip to main content

http_connect

Function http_connect 

Source
pub async fn http_connect(
    stream: BoxStream,
    target: &TargetAddr,
    auth: Option<(&str, &str)>,
    limits: &HttpConnectLimits,
) -> Result<BoxStream, HttpError>
Expand description

Send an HTTP CONNECT request to an upstream proxy and return the upgraded stream on success.

§Arguments

  • stream - The stream to the upstream proxy
  • target - The target address to connect to
  • auth - Optional (username, password) for Proxy-Authorization
  • limits - Parsing limits for the response

§Returns

The stream after receiving a 2xx response, ready for bidirectional forwarding.