socks5_finalize_accept

Function socks5_finalize_accept 

Source
pub async fn socks5_finalize_accept<T>(
    stream: &mut T,
    reply: &Socks5Reply,
    address: &Address,
) -> Result<()>
where T: AsyncWrite + Unpin,
Available on crate feature socks5 only.
Expand description

Completes a SOCKS5 proxy connection by sending a reply to the client.

After processing a client’s SOCKS5 connection request with socks5_accept, this function sends the appropriate response to indicate success or failure.

§Arguments

  • stream - A mutable reference to an asynchronous stream.
  • reply - The SOCKS5 reply code to send to the client.
  • address - The bound address to include in the response.

§Returns

  • Result<()> - Success if the response is sent, or an IO error if writing fails.