Skip to main content

connect

Function connect 

Source
pub async fn connect(
    stream: BoxStream,
    target: &Target,
    username: Option<&str>,
) -> Result<BoxStream>
Expand description

Perform a SOCKS4 / SOCKS4a CONNECT handshake on an already-connected stream.

If target is Target::Host, SOCKS4a extension is used (fake IP 0.0.0.1, hostname appended after the username field).

§Errors

Returns an error if the handshake fails or the proxy reports a non-success status.