pub struct HttpUpgradeMitmRelay<M, S> { /* private fields */ }Expand description
Http middleware that can be used by MITM proxies, such as transparent (L4) proxies to relay a HTTP upgrade-request as-is and pipe the upgraded upgrade request on both ends via the upgrade (bridgeIo) svc.
Implementations§
Source§impl<M, S> HttpUpgradeMitmRelay<M, S>
impl<M, S> HttpUpgradeMitmRelay<M, S>
Sourcepub fn new(exec: Executor, nested_matcher_svc: M, inner_svc: S) -> Self
pub fn new(exec: Executor, nested_matcher_svc: M, inner_svc: S) -> Self
Create a new HttpUpgradeMitmRelay.
Sourcepub fn with_error_sink(self, sink: impl ErrorSink) -> Self
pub fn with_error_sink(self, sink: impl ErrorSink) -> Self
Set a custom ErrorSink used to observe errors from the detached
relay task (relay-service failures and upgrade failures on either side).
Defaults to TracingErrorSink::default (traces at DEBUG level).
Trait Implementations§
Source§impl<M: Clone, S: Clone> Clone for HttpUpgradeMitmRelay<M, S>
impl<M: Clone, S: Clone> Clone for HttpUpgradeMitmRelay<M, S>
Source§fn clone(&self) -> HttpUpgradeMitmRelay<M, S>
fn clone(&self) -> HttpUpgradeMitmRelay<M, S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<M, S, ReqBody, ModReqBody, ResBody, ModResBody> Service<Request<ReqBody>> for HttpUpgradeMitmRelay<M, S>where
M: ServiceMatcher<Request<ReqBody>, Error: IntoResponse, ModifiedInput = Request<ModReqBody>, Service: ServiceMatcher<Response<ResBody>, Error: Into<S::Error>, ModifiedInput = Response<ModResBody>, Service: Service<BridgeIo<Upgraded, Upgraded>, Output = (), Error: Into<BoxError>>>>,
S: Service<Request, Output = Response<ResBody>>,
ReqBody: StreamingBody<Data = Bytes, Error: Into<BoxError>> + Send + Sync + 'static,
ModReqBody: StreamingBody<Data = Bytes, Error: Into<BoxError>> + Send + Sync + 'static,
ResBody: StreamingBody<Data = Bytes, Error: Into<BoxError>> + Send + Sync + 'static,
ModResBody: StreamingBody<Data = Bytes, Error: Into<BoxError>> + Send + Sync + 'static,
impl<M, S, ReqBody, ModReqBody, ResBody, ModResBody> Service<Request<ReqBody>> for HttpUpgradeMitmRelay<M, S>where
M: ServiceMatcher<Request<ReqBody>, Error: IntoResponse, ModifiedInput = Request<ModReqBody>, Service: ServiceMatcher<Response<ResBody>, Error: Into<S::Error>, ModifiedInput = Response<ModResBody>, Service: Service<BridgeIo<Upgraded, Upgraded>, Output = (), Error: Into<BoxError>>>>,
S: Service<Request, Output = Response<ResBody>>,
ReqBody: StreamingBody<Data = Bytes, Error: Into<BoxError>> + Send + Sync + 'static,
ModReqBody: StreamingBody<Data = Bytes, Error: Into<BoxError>> + Send + Sync + 'static,
ResBody: StreamingBody<Data = Bytes, Error: Into<BoxError>> + Send + Sync + 'static,
ModResBody: StreamingBody<Data = Bytes, Error: Into<BoxError>> + Send + Sync + 'static,
Auto Trait Implementations§
impl<M, S> !RefUnwindSafe for HttpUpgradeMitmRelay<M, S>
impl<M, S> !UnwindSafe for HttpUpgradeMitmRelay<M, S>
impl<M, S> Freeze for HttpUpgradeMitmRelay<M, S>
impl<M, S> Send for HttpUpgradeMitmRelay<M, S>
impl<M, S> Sync for HttpUpgradeMitmRelay<M, S>
impl<M, S> Unpin for HttpUpgradeMitmRelay<M, S>
impl<M, S> UnsafeUnpin for HttpUpgradeMitmRelay<M, S>where
M: UnsafeUnpin,
S: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Mutably borrows from an owned value. Read more
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,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<S, Body> HttpClientExt for S
impl<S, Body> HttpClientExt for S
Source§type ExecuteResponse = Response<Body>
type ExecuteResponse = Response<Body>
The response type returned by the
execute method.Source§type ExecuteError = <S as Service<Request>>::Error
type ExecuteError = <S as Service<Request>>::Error
The error type returned by the
execute method.Source§fn get(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn get( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Convenience method to make a
GET request to a URL. Read moreSource§fn post(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn post( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Convenience method to make a
POST request to a URL. Read moreSource§fn put(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn put( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Convenience method to make a
PUT request to a URL. Read moreSource§fn patch(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn patch( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Convenience method to make a
PATCH request to a URL. Read moreSource§fn delete(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn delete( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Convenience method to make a
DELETE request to a URL. Read moreSource§fn head(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn head( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Convenience method to make a
HEAD request to a URL. Read moreSource§fn connect(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn connect( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Convenience method to make a
CONNECT request to a URL. Read moreSource§fn request(
&self,
method: Method,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn request( &self, method: Method, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Source§fn build_from_request<RequestBody>(
&self,
request: Request<RequestBody>,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn build_from_request<RequestBody>( &self, request: Request<RequestBody>, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Source§fn execute(
&self,
request: Request,
) -> impl Future<Output = Result<<S as HttpClientExt>::ExecuteResponse, <S as HttpClientExt>::ExecuteError>>
fn execute( &self, request: Request, ) -> impl Future<Output = Result<<S as HttpClientExt>::ExecuteResponse, <S as HttpClientExt>::ExecuteError>>
Executes a
Request. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreSource§impl<S> IntoEndpointService<(S,)> for S
impl<S> IntoEndpointService<(S,)> for S
type Service = S
Source§fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
convert the type into a
rama_core::Service.Source§impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
type Service = S
Source§fn into_endpoint_service_with_state(
self,
_state: State,
) -> <S as IntoEndpointServiceWithState<(S,), State>>::Service
fn into_endpoint_service_with_state( self, _state: State, ) -> <S as IntoEndpointServiceWithState<(S,), State>>::Service
convert the type into a
rama_core::Service with state.