Struct Http3MitmRelay
pub struct Http3MitmRelay<M = (ConsumeErrLayer<Trace, StaticOutput<DefaultErrorResponse>>, ArcLayer), P = bool> { /* private fields */ }http-backend only.Expand description
Relays HTTP/3 between a server connection (ingress) and a client connection (egress) that
were established and authenticated before: the HTTP/3 counterpart of
HttpMitmRelay.
Requests pass through the same HTTP middleware model: hop-by-hop fields are consumed at the
boundary and Self::with_bound_authority checks every request before and after the
middleware. Each hop keeps its own QPACK state; egress SETTINGS arrive before
the ingress side advertises its own, so Extended CONNECT is offered only when the origin
supports it, and ingress field sections are bounded by the origin’s limit. Priorities follow
each request upstream, CONNECT and Extended CONNECT tunnels are bridged until both
directions finish, and middleware selects Capsule/HTTP Datagram semantics with
HttpDatagrams. GOAWAY from either side drains the relay.
Each hop advertises the other peer’s initial SETTINGS in their original order, limited to
what this relay implements plus GREASE: values are lowered to the local hop’s budgets, an
origin’s Extended CONNECT grant is dropped unless ingress offers it, and HTTP Datagram
grants unless both hops carry datagrams; a client’s ENABLE_CONNECT_PROTOCOL grants nothing
and is kept. Other settings are dropped and traced. SETTINGS missing the readiness deadline
leave the other hop on its own. An explicit Config::settings_profile on a hop is used
as configured instead.
Early requests and server push are disabled on both hops. A relay that
fails, or whose serve future is dropped (even before it is first polled), closes both
connections with H3_INTERNAL_ERROR.
Implementations§
§impl Http3MitmRelay
impl Http3MitmRelay
pub fn new(exec: Executor) -> Http3MitmRelay
pub fn new(exec: Executor) -> Http3MitmRelay
Create a relay with default per-hop configurations; ingress offers Extended CONNECT whenever the origin does.
§impl<M, P> Http3MitmRelay<M, P>
impl<M, P> Http3MitmRelay<M, P>
Bind the relayed connection to its trusted logical origin and policy.
Mismatches return 421 without opening an upstream request stream.
pub fn with_http_middleware<N>(self, middleware: N) -> Http3MitmRelay<N, P>
pub fn with_http_middleware<N>(self, middleware: N) -> Http3MitmRelay<N, P>
Set the HTTP middleware between the ingress server and the egress client.
pub fn with_ingress_config(self, config: Config) -> Http3MitmRelay<M, P>
pub fn with_ingress_config(self, config: Config) -> Http3MitmRelay<M, P>
HTTP/3 settings of the ingress (server) side.
pub fn set_ingress_config(
&mut self,
config: Config,
) -> &mut Http3MitmRelay<M, P>
pub fn set_ingress_config( &mut self, config: Config, ) -> &mut Http3MitmRelay<M, P>
HTTP/3 settings of the ingress (server) side.
pub fn with_egress_config(self, config: Config) -> Http3MitmRelay<M, P>
pub fn with_egress_config(self, config: Config) -> Http3MitmRelay<M, P>
HTTP/3 settings of the egress (client) side.
pub fn set_egress_config(&mut self, config: Config) -> &mut Http3MitmRelay<M, P>
pub fn set_egress_config(&mut self, config: Config) -> &mut Http3MitmRelay<M, P>
HTTP/3 settings of the egress (client) side.
pub fn with_settings_timeout(self, timeout: Duration) -> Http3MitmRelay<M, P>
pub fn with_settings_timeout(self, timeout: Duration) -> Http3MitmRelay<M, P>
How long both QUIC handshakes, optional client SETTINGS readiness and
the origin’s SETTINGS may take, counted from the
moment serve is called. Defaults to DEFAULT_EAGER_PEER_SETTINGS_TIMEOUT.
pub fn set_settings_timeout(
&mut self,
timeout: Duration,
) -> &mut Http3MitmRelay<M, P>
pub fn set_settings_timeout( &mut self, timeout: Duration, ) -> &mut Http3MitmRelay<M, P>
How long both QUIC handshakes, optional client SETTINGS readiness and
the origin’s SETTINGS may take, counted from the
moment serve is called. Defaults to DEFAULT_EAGER_PEER_SETTINGS_TIMEOUT.
pub fn with_forbidden_trailers(
self,
forbidden_trailers: ForbiddenTrailers,
) -> Http3MitmRelay<M, P>
pub fn with_forbidden_trailers( self, forbidden_trailers: ForbiddenTrailers, ) -> Http3MitmRelay<M, P>
Which trailer fields are forwarded although their definitions forbid them in
trailers. Defaults to ForbiddenTrailers::AllowAll.
pub fn set_forbidden_trailers(
&mut self,
forbidden_trailers: ForbiddenTrailers,
) -> &mut Http3MitmRelay<M, P>
pub fn set_forbidden_trailers( &mut self, forbidden_trailers: ForbiddenTrailers, ) -> &mut Http3MitmRelay<M, P>
Which trailer fields are forwarded although their definitions forbid them in
trailers. Defaults to ForbiddenTrailers::AllowAll.
Trait Implementations§
§impl<M, P> Clone for Http3MitmRelay<M, P>
impl<M, P> Clone for Http3MitmRelay<M, P>
§fn clone(&self) -> Http3MitmRelay<M, P>
fn clone(&self) -> Http3MitmRelay<M, P>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<M, P> Debug for Http3MitmRelay<M, P>
impl<M, P> Debug for Http3MitmRelay<M, P>
§impl<M, P> Service<BridgeIo<Connection, Connection>> for Http3MitmRelay<M, P>where
(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>): Layer<Http3EgressService> + Clone,
<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<Http3EgressService>>::Service: Service<Request, Output = Response> + Clone,
<<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<Http3EgressService>>::Service as Service<Request>>::Error: Into<Box<dyn Error + Sync + Send>>,
M: Send + Sync + 'static + Clone,
P: Matcher<Request> + Clone,
impl<M, P> Service<BridgeIo<Connection, Connection>> for Http3MitmRelay<M, P>where
(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>): Layer<Http3EgressService> + Clone,
<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<Http3EgressService>>::Service: Service<Request, Output = Response> + Clone,
<<(RemoveRequestHeaderLayer, M, RemoveResponseHeaderLayer, ValidateRequestHeaderLayer<Option<BoundAuthority<P>>>) as Layer<Http3EgressService>>::Service as Service<Request>>::Error: Into<Box<dyn Error + Sync + Send>>,
M: Send + Sync + 'static + Clone,
P: Matcher<Request> + Clone,
Auto Trait Implementations§
impl<M = (ConsumeErrLayer<Trace, StaticOutput<DefaultErrorResponse>>, ArcLayer), P = bool> !Freeze for Http3MitmRelay<M, P>
impl<M, P> RefUnwindSafe for Http3MitmRelay<M, P>
impl<M, P> Send for Http3MitmRelay<M, P>
impl<M, P> Sync for Http3MitmRelay<M, P>
impl<M, P> Unpin for Http3MitmRelay<M, P>
impl<M, P> UnsafeUnpin for Http3MitmRelay<M, P>
impl<M, P> UnwindSafe for Http3MitmRelay<M, P>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more