Struct HttpForwardProxyConnector
pub struct HttpForwardProxyConnector<S> { /* private fields */ }dns and http-backend and http and std and tcp only.Expand description
A connector which reaches the origin of a forwarded request over the HTTP connection to its proxy: the proxy plays origin for it, and the request names its own origin.
A forwarded route is required: any other input fails. Pair it with a
MaybeProxiedConnector over HttpForwardRoute to reach an origin of its own instead.
The inner service dials the HTTP connection to the proxy, the same one
HttpConnectProxyConnector tunnels over, such as a ProxyDialer over the
connector towards HTTP proxies. This connector hands that connection out as the
connection of the request. Several origins forwarded through one proxy
share that connection when it can carry them.
Implementations§
§impl<S> HttpForwardProxyConnector<ProxyDialer<S>>
impl<S> HttpForwardProxyConnector<ProxyDialer<S>>
pub const fn new(inner: S) -> HttpForwardProxyConnector<ProxyDialer<S>>
pub const fn new(inner: S) -> HttpForwardProxyConnector<ProxyDialer<S>>
Create an HttpForwardProxyConnector over the connector towards HTTP proxies.
§impl<S> HttpForwardProxyConnector<S>
impl<S> HttpForwardProxyConnector<S>
pub const fn from_dialer(dialer: S) -> HttpForwardProxyConnector<S>
pub const fn from_dialer(dialer: S) -> HttpForwardProxyConnector<S>
Create an HttpForwardProxyConnector over the HTTP connections to the proxy that
dialer dials, see ProxyDialer.
pub fn with_proxy_auth(self, enabled: bool) -> HttpForwardProxyConnector<S>
pub fn with_proxy_auth(self, enabled: bool) -> HttpForwardProxyConnector<S>
Send the credentials of a forwarded request’s own route to the proxy; enabled by default. Disabling it only disables insertion: a header the request supplies itself still travels, for manual and challenge-driven authentication.
pub fn set_proxy_auth(
&mut self,
enabled: bool,
) -> &mut HttpForwardProxyConnector<S>
pub fn set_proxy_auth( &mut self, enabled: bool, ) -> &mut HttpForwardProxyConnector<S>
Send the credentials of a forwarded request’s own route to the proxy; enabled by default. Disabling it only disables insertion: a header the request supplies itself still travels, for manual and challenge-driven authentication.
pub fn with_isolate_auth_error(
self,
enabled: bool,
) -> HttpForwardProxyConnector<S>
pub fn with_isolate_auth_error( self, enabled: bool, ) -> HttpForwardProxyConnector<S>
Turn a proxy’s 407 into HttpForwardProxyAuthRequired instead of answering
with it, so an intermediary never hands one proxy’s challenge to its own client.
pub fn set_isolate_auth_error(
&mut self,
enabled: bool,
) -> &mut HttpForwardProxyConnector<S>
pub fn set_isolate_auth_error( &mut self, enabled: bool, ) -> &mut HttpForwardProxyConnector<S>
Turn a proxy’s 407 into HttpForwardProxyAuthRequired instead of answering
with it, so an intermediary never hands one proxy’s challenge to its own client.
pub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes self, returning the underlying service.
Trait Implementations§
§impl<S> Clone for HttpForwardProxyConnector<S>where
S: Clone,
impl<S> Clone for HttpForwardProxyConnector<S>where
S: Clone,
§fn clone(&self) -> HttpForwardProxyConnector<S>
fn clone(&self) -> HttpForwardProxyConnector<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<S> Debug for HttpForwardProxyConnector<S>where
S: Debug,
impl<S> Debug for HttpForwardProxyConnector<S>where
S: Debug,
§impl<S, Input> Service<Input> for HttpForwardProxyConnector<S>where
S: ConnectorService<ProxyDialRequest>,
Input: ProtocolInputExt + ExtensionsRef + Send + 'static,
impl<S, Input> Service<Input> for HttpForwardProxyConnector<S>where
S: ConnectorService<ProxyDialRequest>,
Input: ProtocolInputExt + ExtensionsRef + Send + 'static,
§type Output = EstablishedClientConnection<HttpForwardProxyConnection<<S as ConnectorService<ProxyDialRequest>>::Connection>, Input>
type Output = EstablishedClientConnection<HttpForwardProxyConnection<<S as ConnectorService<ProxyDialRequest>>::Connection>, Input>
§type Error = ConnectionError
type Error = ConnectionError
§async fn serve(
&self,
input: Input,
) -> Result<<HttpForwardProxyConnector<S> as Service<Input>>::Output, <HttpForwardProxyConnector<S> as Service<Input>>::Error>
async fn serve( &self, input: Input, ) -> Result<<HttpForwardProxyConnector<S> as Service<Input>>::Output, <HttpForwardProxyConnector<S> as Service<Input>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
Auto Trait Implementations§
impl<S> Forget for HttpForwardProxyConnector<S>
impl<S> Freeze for HttpForwardProxyConnector<S>where
S: Freeze,
impl<S> Move for HttpForwardProxyConnector<S>
impl<S> RefUnwindSafe for HttpForwardProxyConnector<S>where
S: RefUnwindSafe,
impl<S> Send for HttpForwardProxyConnector<S>where
S: Send,
impl<S> Sync for HttpForwardProxyConnector<S>where
S: Sync,
impl<S> Unpin for HttpForwardProxyConnector<S>where
S: Unpin,
impl<S> UnsafeUnpin for HttpForwardProxyConnector<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for HttpForwardProxyConnector<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
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<S> IntoEndpointService<(S,)> for S
impl<S> IntoEndpointService<(S,)> for S
type Service = S
§fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
rama_core::Service.§impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
type Service = S
§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
rama_core::Service with state.§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<Io, S> MakeMockServer<Io, ServerClone> for S
impl<Io, S> MakeMockServer<Io, ServerClone> for S
type Server = S
fn make_server(&self, _: &ConnectRequest) -> S
§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