Struct HttpWebSocketRelayServiceRequestMatcher
pub struct HttpWebSocketRelayServiceRequestMatcher<S = IoForwardService> { /* private fields */ }Expand description
Default matcher that can be used for Http websocket relays.
Request matches for an http websocket request return
a HttpWebSocketRelayServiceResponseMatcher instance which
will match on 101 status code responses…
§Note
This matcher does NOT validate if client <-> server handshake flow is compatible with one another. This in contrast to Rama’s pure client / server implementations, the MITM flow typically should not botter with that, given there are always those odd balls out there which have RFC incompatible definitions of reality. Fork this file if you have more advanced needs… or feel free to make a proposal on improvements to this file while still respecting its spirit.
Implementations§
§impl<S> HttpWebSocketRelayServiceRequestMatcher<S>
impl<S> HttpWebSocketRelayServiceRequestMatcher<S>
pub fn new(relay_svc: S) -> HttpWebSocketRelayServiceRequestMatcher<S>
pub fn new(relay_svc: S) -> HttpWebSocketRelayServiceRequestMatcher<S>
Create a new HttpWebSocketRelayServiceRequestMatcher.
pub fn maybe_with_websocket_config(
self,
cfg: Option<WebSocketConfig>,
) -> HttpWebSocketRelayServiceRequestMatcher<S>
pub fn maybe_with_websocket_config( self, cfg: Option<WebSocketConfig>, ) -> HttpWebSocketRelayServiceRequestMatcher<S>
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
pub fn maybe_set_websocket_config(
&mut self,
cfg: Option<WebSocketConfig>,
) -> &mut HttpWebSocketRelayServiceRequestMatcher<S>
pub fn maybe_set_websocket_config( &mut self, cfg: Option<WebSocketConfig>, ) -> &mut HttpWebSocketRelayServiceRequestMatcher<S>
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
pub fn with_websocket_config(
self,
cfg: WebSocketConfig,
) -> HttpWebSocketRelayServiceRequestMatcher<S>
pub fn with_websocket_config( self, cfg: WebSocketConfig, ) -> HttpWebSocketRelayServiceRequestMatcher<S>
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
pub fn set_websocket_config(
&mut self,
cfg: WebSocketConfig,
) -> &mut HttpWebSocketRelayServiceRequestMatcher<S>
pub fn set_websocket_config( &mut self, cfg: WebSocketConfig, ) -> &mut HttpWebSocketRelayServiceRequestMatcher<S>
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
pub fn without_websocket_config(
self,
) -> HttpWebSocketRelayServiceRequestMatcher<S>
pub fn without_websocket_config( self, ) -> HttpWebSocketRelayServiceRequestMatcher<S>
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
pub fn unset_websocket_config(
&mut self,
) -> &mut HttpWebSocketRelayServiceRequestMatcher<S>
pub fn unset_websocket_config( &mut self, ) -> &mut HttpWebSocketRelayServiceRequestMatcher<S>
Set the base WebSocketConfig, used for both sides,
overwriting the previous config if already set.
pub fn with_store_handshake_request_header(
self,
store: bool,
) -> HttpWebSocketRelayServiceRequestMatcher<S>
pub fn with_store_handshake_request_header( self, store: bool, ) -> HttpWebSocketRelayServiceRequestMatcher<S>
Define if the handshake (http) request headers needs to be stored in the Ingress Io extensions.
By default it is not stored.
§Note
It is only stored if requested AND the request is matched.
pub fn set_store_handshake_request_header(
&mut self,
store: bool,
) -> &mut HttpWebSocketRelayServiceRequestMatcher<S>
pub fn set_store_handshake_request_header( &mut self, store: bool, ) -> &mut HttpWebSocketRelayServiceRequestMatcher<S>
Define if the handshake (http) request headers needs to be stored in the Ingress Io extensions.
By default it is not stored.
§Note
It is only stored if requested AND the request is matched.
pub fn with_store_handshake_response_header(
self,
store: bool,
) -> HttpWebSocketRelayServiceRequestMatcher<S>
pub fn with_store_handshake_response_header( self, store: bool, ) -> HttpWebSocketRelayServiceRequestMatcher<S>
Define if the handshake (http) response headers needs to be stored in the Ingress Io extensions.
By default it is not stored.
§Note
It is only stored if requested AND the response is matched.
pub fn set_store_handshake_response_header(
&mut self,
store: bool,
) -> &mut HttpWebSocketRelayServiceRequestMatcher<S>
pub fn set_store_handshake_response_header( &mut self, store: bool, ) -> &mut HttpWebSocketRelayServiceRequestMatcher<S>
Define if the handshake (http) response headers needs to be stored in the Ingress Io extensions.
By default it is not stored.
§Note
It is only stored if requested AND the response is matched.
Trait Implementations§
§impl<S> Clone for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Clone,
impl<S> Clone for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Clone,
§fn clone(&self) -> HttpWebSocketRelayServiceRequestMatcher<S>
fn clone(&self) -> HttpWebSocketRelayServiceRequestMatcher<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<S> Debug for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Debug,
impl<S> Debug for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Debug,
§impl Default for HttpWebSocketRelayServiceRequestMatcher
impl Default for HttpWebSocketRelayServiceRequestMatcher
§fn default() -> HttpWebSocketRelayServiceRequestMatcher
fn default() -> HttpWebSocketRelayServiceRequestMatcher
§impl<S, Body> ServiceMatcher<Request<Body>> for HttpWebSocketRelayServiceRequestMatcher<S>
impl<S, Body> ServiceMatcher<Request<Body>> for HttpWebSocketRelayServiceRequestMatcher<S>
§type Service = HttpWebSocketRelayServiceResponseMatcher<S>
type Service = HttpWebSocketRelayServiceResponseMatcher<S>
§type Error = Infallible
type Error = Infallible
§type ModifiedInput = Request<Body>
type ModifiedInput = Request<Body>
§async fn match_service(
&self,
req: Request<Body>,
) -> Result<ServiceMatch<<HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::ModifiedInput, <HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::Service>, <HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::Error>
async fn match_service( &self, req: Request<Body>, ) -> Result<ServiceMatch<<HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::ModifiedInput, <HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::Service>, <HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::Error>
input.§async fn into_match_service(
self,
req: Request<Body>,
) -> Result<ServiceMatch<<HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::ModifiedInput, <HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::Service>, <HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::Error>
async fn into_match_service( self, req: Request<Body>, ) -> Result<ServiceMatch<<HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::ModifiedInput, <HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::Service>, <HttpWebSocketRelayServiceRequestMatcher<S> as ServiceMatcher<Request<Body>>>::Error>
input, consuming the matcher. Read more§fn boxed(
self,
) -> BoxServiceMatcher<Input, Self::Service, Self::Error, Self::ModifiedInput>where
Self: Sized,
fn boxed(
self,
) -> BoxServiceMatcher<Input, Self::Service, Self::Error, Self::ModifiedInput>where
Self: Sized,
Auto Trait Implementations§
impl<S> Freeze for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Freeze,
impl<S> RefUnwindSafe for HttpWebSocketRelayServiceRequestMatcher<S>where
S: RefUnwindSafe,
impl<S> Send for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Send,
impl<S> Sync for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Sync,
impl<S> Unpin for HttpWebSocketRelayServiceRequestMatcher<S>where
S: Unpin,
impl<S> UnsafeUnpin for HttpWebSocketRelayServiceRequestMatcher<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for HttpWebSocketRelayServiceRequestMatcher<S>where
S: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Input, T> DynServiceMatcher<Input> for Twhere
T: ServiceMatcher<Input>,
impl<Input, T> DynServiceMatcher<Input> for Twhere
T: ServiceMatcher<Input>,
§type Service = <T as ServiceMatcher<Input>>::Service
type Service = <T as ServiceMatcher<Input>>::Service
§type Error = <T as ServiceMatcher<Input>>::Error
type Error = <T as ServiceMatcher<Input>>::Error
§type ModifiedInput = <T as ServiceMatcher<Input>>::ModifiedInput
type ModifiedInput = <T as ServiceMatcher<Input>>::ModifiedInput
§fn match_service_box(
&self,
input: Input,
) -> Pin<Box<dyn Future<Output = Result<ServiceMatch<<T as DynServiceMatcher<Input>>::ModifiedInput, <T as DynServiceMatcher<Input>>::Service>, <T as DynServiceMatcher<Input>>::Error>> + Send + '_>>
fn match_service_box( &self, input: Input, ) -> Pin<Box<dyn Future<Output = Result<ServiceMatch<<T as DynServiceMatcher<Input>>::ModifiedInput, <T as DynServiceMatcher<Input>>::Service>, <T as DynServiceMatcher<Input>>::Error>> + Send + '_>>
input.§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