pub async fn connect(
stream: BoxStream,
target: &Target,
username: Option<&str>,
password: Option<&str>,
) -> Result<BoxStream>Expand description
Perform an HTTP CONNECT tunnel handshake on an already-connected stream.
If username and password are provided, a Proxy-Authorization: Basic
header is included.
§Errors
Returns an error if the proxy responds with a non-2xx status code or the response headers cannot be parsed.