Skip to main content

DefaultHttpWebClient

Type Alias DefaultHttpWebClient 

Source
pub type DefaultHttpWebClient<Body = Body> = EasyHttpWebClient<Body, EstablishedClientConnection<AltSvc<BindBodyToConn<MultiplexedConnection<HttpClientService<Body>, HttpConnId>>>, Request<Body>>, ()>;
Available on crate features dns and http-backend and http and std and tcp only.
Expand description

Rama’s default asynchronous HTTP(S) client, including its default multiplexing connection pool.

With BoringSSL or Rustls plus ring/aws-lc, HTTP/3 is available through alternative-service discovery or an explicit HTTP/3 request. Its shared UDP endpoint is bound lazily, so constructing the client requires no runtime.

Like a browser it resumes TLS sessions (with BoringSSL, also over TCP), which lets servers link the connections of one client. It acts for a single user: proxies relay traffic instead of sharing one client between their users.

Aliased Type§

pub struct DefaultHttpWebClient<Body = Body> { /* private fields */ }

Implementations§

Source§

impl<Body> DefaultHttpWebClient<Body>
where Body: StreamingBody<Data: Send + 'static, Error: Into<BoxError>> + Unpin + Send + 'static,

Source

pub fn default_with_scope(scope: impl Into<WeakScope>) -> Self

Source

pub fn default_masque_proxy_client_with_scope( scope: impl Into<WeakScope>, ) -> Self

Available on crate feature masque only.

A client to MASQUE proxies, for the tunnels another client’s HTTP/3 runs in: the default client, with room in its own HTTP/3 connections for the tunneled QUIC packets (masque_quic_transport).

Source

pub fn try_default_masque_proxy_client_using_boringssl( scope: impl Into<WeakScope>, proxy_tls: TlsClientConfig, ) -> Result<Self, BoxError>

Available on crate feature masque only.

Self::default_masque_proxy_client_with_scope, with proxy_tls towards the proxies, such as TlsClientConfig::default_http with a server verification of its own.

Source

pub fn default_masque_with_scope(scope: impl Into<WeakScope>) -> Self

Available on crate feature masque only.

The default client, with its HTTP/3 also through MASQUE proxies: in CONNECT-UDP tunnels (RFC 9298) opened by a Self::default_masque_proxy_client_with_scope client.

Each HTTP/3 connection has a UDP socket or tunnel of its own.

Source

pub fn try_default_masque_using_boringssl( scope: impl Into<WeakScope>, tls: TlsClientConfig, proxy_tls: TlsClientConfig, ) -> Result<Self, BoxError>

Available on crate feature masque only.

Self::default_masque_with_scope, with tls towards origins and proxy_tls towards proxies, MASQUE and HTTPS proxies alike.

Trait Implementations§

Source§

impl<Body> Default for DefaultHttpWebClient<Body>
where Body: StreamingBody<Data: Send + 'static, Error: Into<BoxError>> + Unpin + Send + 'static,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more