socks5_accept

Function socks5_accept 

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

Accepts a SOCKS5 proxy connection request from a client.

This function reads, responses and processes an SOCKS5 handshake from the client, validates authentication if required, and extracts the command and target address.

§Arguments

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

§Returns

  • Result<(Socks5Command, Address)> - The requested command and target address on success, or an error if the handshake fails, authentication fails, or the request is invalid.