Skip to main content

http_connect

Function http_connect 

pub async fn http_connect<T, Input, BodyConnection>(
    transport: T,
    input: Input,
    exec: Executor,
) -> Result<EstablishedClientConnection<HttpClientService<BodyConnection>, Input>, OpaqueError>
where T: IntoHttpTransport, Input: AuthorityInputExt + ProtocolInputExt + ExtensionsRef + HttpVersionInputExt + TargetHttpVersionInputExt + Send + 'static, BodyConnection: Body + Unpin + Send + 'static, <BodyConnection as Body>::Data: Send + 'static, <BodyConnection as Body>::Error: Into<Box<dyn Error + Sync + Send>>,
Available on crate features dns and http-backend and http and std and tcp only.
Expand description

Perform the HTTP handshake on an established byte stream or QUIC transport. The selected protocol must agree with the transport; metadata remains attached to the resulting service for pooling and request adaptation. The input’s protocol distinguishes secure origins without inferring TLS from a port. Custom secure transports must publish ConnectionReuse to enable pooling.