http_accept

Function http_accept 

Source
pub async fn http_accept<T>(
    stream: &mut T,
    auth_method: &AuthMethod,
) -> Result<Address>
where T: AsyncRead + Unpin,
Available on crate feature http only.
Expand description

Accepts an HTTP proxy connection request from a client.

This function reads and processes an HTTP CONNECT request from the client, validates authentication if required, and extracts the target address.

§Arguments

  • stream - A mutable reference to an asynchronous stream implementing AsyncRead + Unpin.
  • auth_method - The authentication method required for this connection.

§Returns

  • Result<Address> - The parsed target address on success, or an error if the request is invalid, authentication fails, or the connection cannot be established.