Struct PeekQuicClientHelloService
pub struct PeekQuicClientHelloService<K, S, F = RejectService<(), NoQuicRejectError>> { /* private fields */ }quic and std only.Expand description
Inspects the first datagrams of a UDP association for a QUIC client’s Initial flight and its ClientHello, then hands the association on with those datagrams replayed in front.
A complete ClientHello goes to the inner service as InputWithQuicClientHello. Anything
else ends in a QuicPeekRejection: classes the QuicPeekFallbackPolicy admits go to
the fallback with the same datagrams intact and the rejection in the input’s extensions, so
the fallback can still forward the association untouched; the others fail with
QuicPeekRejectedError. Nothing is ever sent while peeking: the decision is made before
any local QUIC output exists. The deadline is absolute from serve, and the read ahead is
bounded by CaptureLimits.
Routing sees the outer ClientHello only: with ECH that is the public name, never the
encrypted inner one. 0-RTT in the first flight is never decrypted: it is flagged as
PeekedClientHello::early_data_observed and replayed untouched to a forwarding service,
while a terminating relay rejects it and the client resends that data after the handshake.
The fallback rejects by default; use Self::with_fallback to forward instead.
Implementations§
§impl<K, S> PeekQuicClientHelloService<K, S>
impl<K, S> PeekQuicClientHelloService<K, S>
pub fn new(keys: K, inner: S) -> PeekQuicClientHelloService<K, S>
pub fn new(keys: K, inner: S) -> PeekQuicClientHelloService<K, S>
Peek with keys deriving the Initial keys of the client’s offered version. No
certificate or server identity is needed.
§impl<K, S, F> PeekQuicClientHelloService<K, S, F>
impl<K, S, F> PeekQuicClientHelloService<K, S, F>
pub fn with_fallback<G>(
self,
fallback: G,
) -> PeekQuicClientHelloService<K, S, G>
pub fn with_fallback<G>( self, fallback: G, ) -> PeekQuicClientHelloService<K, S, G>
Hand associations the fallback policy admits to fallback.
pub fn with_first_flight_retention(
self,
retain: bool,
) -> PeekQuicClientHelloService<K, S, F>
pub fn with_first_flight_retention( self, retain: bool, ) -> PeekQuicClientHelloService<K, S, F>
Retain structural facts through the datagram completing ClientHello (default: on). A native mirror uses these facts for fresh Initial packetization and CID lengths.
pub fn set_first_flight_retention(
&mut self,
retain: bool,
) -> &mut PeekQuicClientHelloService<K, S, F>
pub fn set_first_flight_retention( &mut self, retain: bool, ) -> &mut PeekQuicClientHelloService<K, S, F>
Retain structural facts through the datagram completing ClientHello (default: on). A native mirror uses these facts for fresh Initial packetization and CID lengths.
pub fn with_limits(
self,
limits: CaptureLimits,
) -> PeekQuicClientHelloService<K, S, F>
pub fn with_limits( self, limits: CaptureLimits, ) -> PeekQuicClientHelloService<K, S, F>
Bounds on the datagrams, packets and bytes read ahead.
pub fn set_limits(
&mut self,
limits: CaptureLimits,
) -> &mut PeekQuicClientHelloService<K, S, F>
pub fn set_limits( &mut self, limits: CaptureLimits, ) -> &mut PeekQuicClientHelloService<K, S, F>
Bounds on the datagrams, packets and bytes read ahead.
pub fn with_peek_timeout(
self,
timeout: Duration,
) -> PeekQuicClientHelloService<K, S, F>
pub fn with_peek_timeout( self, timeout: Duration, ) -> PeekQuicClientHelloService<K, S, F>
How long the whole inspection may take, from serve. Defaults to
DEFAULT_QUIC_PEEK_TIMEOUT.
pub fn set_peek_timeout(
&mut self,
timeout: Duration,
) -> &mut PeekQuicClientHelloService<K, S, F>
pub fn set_peek_timeout( &mut self, timeout: Duration, ) -> &mut PeekQuicClientHelloService<K, S, F>
How long the whole inspection may take, from serve. Defaults to
DEFAULT_QUIC_PEEK_TIMEOUT.
pub fn with_fallback_policy(
self,
policy: QuicPeekFallbackPolicy,
) -> PeekQuicClientHelloService<K, S, F>
pub fn with_fallback_policy( self, policy: QuicPeekFallbackPolicy, ) -> PeekQuicClientHelloService<K, S, F>
Which rejections reach the fallback. Defaults to
QuicPeekFallbackPolicy::NOT_QUIC.
pub fn set_fallback_policy(
&mut self,
policy: QuicPeekFallbackPolicy,
) -> &mut PeekQuicClientHelloService<K, S, F>
pub fn set_fallback_policy( &mut self, policy: QuicPeekFallbackPolicy, ) -> &mut PeekQuicClientHelloService<K, S, F>
Which rejections reach the fallback. Defaults to
QuicPeekFallbackPolicy::NOT_QUIC.
Trait Implementations§
§impl<K, S, F> Clone for PeekQuicClientHelloService<K, S, F>
impl<K, S, F> Clone for PeekQuicClientHelloService<K, S, F>
§fn clone(&self) -> PeekQuicClientHelloService<K, S, F>
fn clone(&self) -> PeekQuicClientHelloService<K, S, F>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<K, S, F> Debug for PeekQuicClientHelloService<K, S, F>
impl<K, S, F> Debug for PeekQuicClientHelloService<K, S, F>
§impl<I, K, S, F, O> Service<I> for PeekQuicClientHelloService<K, S, F>where
I: DatagramPeekInput,
<I as DatagramPeekInput>::Mapped<PrefixedDatagramSocket<<I as DatagramPeekInput>::Socket>>: ExtensionsRef,
K: KeyProvider + Send + Sync + 'static,
S: Service<InputWithQuicClientHello<<I as DatagramPeekInput>::Mapped<PrefixedDatagramSocket<<I as DatagramPeekInput>::Socket>>>, Output = O>,
<S as Service<InputWithQuicClientHello<<I as DatagramPeekInput>::Mapped<PrefixedDatagramSocket<<I as DatagramPeekInput>::Socket>>>>>::Error: Into<Box<dyn Error + Send + Sync>>,
F: Service<<I as DatagramPeekInput>::Mapped<PrefixedDatagramSocket<<I as DatagramPeekInput>::Socket>>, Output = O>,
<F as Service<<I as DatagramPeekInput>::Mapped<PrefixedDatagramSocket<<I as DatagramPeekInput>::Socket>>>>::Error: Into<Box<dyn Error + Send + Sync>>,
O: Send + 'static,
impl<I, K, S, F, O> Service<I> for PeekQuicClientHelloService<K, S, F>where
I: DatagramPeekInput,
<I as DatagramPeekInput>::Mapped<PrefixedDatagramSocket<<I as DatagramPeekInput>::Socket>>: ExtensionsRef,
K: KeyProvider + Send + Sync + 'static,
S: Service<InputWithQuicClientHello<<I as DatagramPeekInput>::Mapped<PrefixedDatagramSocket<<I as DatagramPeekInput>::Socket>>>, Output = O>,
<S as Service<InputWithQuicClientHello<<I as DatagramPeekInput>::Mapped<PrefixedDatagramSocket<<I as DatagramPeekInput>::Socket>>>>>::Error: Into<Box<dyn Error + Send + Sync>>,
F: Service<<I as DatagramPeekInput>::Mapped<PrefixedDatagramSocket<<I as DatagramPeekInput>::Socket>>, Output = O>,
<F as Service<<I as DatagramPeekInput>::Mapped<PrefixedDatagramSocket<<I as DatagramPeekInput>::Socket>>>>::Error: Into<Box<dyn Error + Send + Sync>>,
O: Send + 'static,
Auto Trait Implementations§
impl<K, S, F> Freeze for PeekQuicClientHelloService<K, S, F>
impl<K, S, F> RefUnwindSafe for PeekQuicClientHelloService<K, S, F>
impl<K, S, F> Send for PeekQuicClientHelloService<K, S, F>
impl<K, S, F> Sync for PeekQuicClientHelloService<K, S, F>
impl<K, S, F> Unpin for PeekQuicClientHelloService<K, S, F>
impl<K, S, F> UnsafeUnpin for PeekQuicClientHelloService<K, S, F>
impl<K, S, F> UnwindSafe for PeekQuicClientHelloService<K, S, F>
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<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
impl<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
§type Connection = Connection
type Connection = Connection
ConnectorService§fn connect(
&self,
input: Input,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
fn connect( &self, input: Input, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
§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