pub struct ProxyConnector<Socks = (), Connect = (), ConnectUdp = (), Forward = ()> { /* private fields */ }dns and http-backend and http and std and tcp only.Expand description
The proxy methods a client reaches origins with, each over the connections towards
proxies they were built on: see ProxyConnector::builder.
Every method has a slot of its own, and one that is not enabled refuses the routes
asking for it rather than quietly serving them another way. A client’s builder takes the
parts out and places each of them where it belongs, in with_proxy_support.
Implementations§
Source§impl ProxyConnector
impl ProxyConnector
Sourcepub fn builder(scope: impl Into<WeakScope>) -> ProxyConnectorBuilder
pub fn builder(scope: impl Into<WeakScope>) -> ProxyConnectorBuilder
Build the connections towards proxies of a client and the methods it speaks on them.
Sourcepub fn default_with_scope<Body>(
scope: impl Into<WeakScope>,
) -> DefaultProxyConnector<TcpConnector, Body>
pub fn default_with_scope<Body>( scope: impl Into<WeakScope>, ) -> DefaultProxyConnector<TcpConnector, Body>
Every proxy method this build of rama has, over rama’s default connections
towards proxies: TCP, QUIC for an h3:// one, the global DNS resolver, and TLS
for a secure one.
Body is the body type sent to a proxy, the one the client serves origins with.
Sourcepub fn default_using_tls<Body>(
scope: impl Into<WeakScope>,
tls: TlsClientConfig,
) -> DefaultProxyConnector<TcpConnector, Body>
pub fn default_using_tls<Body>( scope: impl Into<WeakScope>, tls: TlsClientConfig, ) -> DefaultProxyConnector<TcpConnector, Body>
Self::default_with_scope, with tls towards the proxies.
Source§impl ProxyConnector<ProxyMethodNotEnabled, ProxyMethodNotEnabled, ProxyConnectUdpNotEnabled<()>, ProxyMethodNotEnabled>
impl ProxyConnector<ProxyMethodNotEnabled, ProxyMethodNotEnabled, ProxyConnectUdpNotEnabled<()>, ProxyMethodNotEnabled>
Sourcepub fn new() -> Self
pub fn new() -> Self
A ProxyConnector with no method yet: each one refuses its routes until it is
given with with_*, as its own stack of layers.
Source§impl<Socks, Connect, ConnectUdp, Forward> ProxyConnector<Socks, Connect, ConnectUdp, Forward>
impl<Socks, Connect, ConnectUdp, Forward> ProxyConnector<Socks, Connect, ConnectUdp, Forward>
Sourcepub fn with_socks<S>(
self,
socks: S,
) -> ProxyConnector<S, Connect, ConnectUdp, Forward>
pub fn with_socks<S>( self, socks: S, ) -> ProxyConnector<S, Connect, ConnectUdp, Forward>
Open a tunnel to the origin over a SOCKS5 proxy with socks.
Sourcepub fn with_connect<C>(
self,
connect: C,
) -> ProxyConnector<Socks, C, ConnectUdp, Forward>
pub fn with_connect<C>( self, connect: C, ) -> ProxyConnector<Socks, C, ConnectUdp, Forward>
Open a tunnel to the origin over an HTTP proxy with CONNECT, with connect.
Sourcepub fn with_connect_udp<U>(
self,
connect_udp: U,
) -> ProxyConnector<Socks, Connect, U, Forward>
pub fn with_connect_udp<U>( self, connect_udp: U, ) -> ProxyConnector<Socks, Connect, U, Forward>
Open a datagram tunnel to the origin with CONNECT-UDP, with connect_udp.
Sourcepub fn with_forward<F>(
self,
forward: F,
) -> ProxyConnector<Socks, Connect, ConnectUdp, F>
pub fn with_forward<F>( self, forward: F, ) -> ProxyConnector<Socks, Connect, ConnectUdp, F>
Have an HTTP proxy forward a plaintext request, with forward.
pub fn into_parts( self, ) -> ProxyConnectorParts<Socks, Connect, ConnectUdp, Forward>
Source§impl<Socks, Connect, ConnectUdp, C> ProxyConnector<Socks, Connect, ConnectUdp, HttpForwardProxyConnector<ProxyDialer<C>>>
impl<Socks, Connect, ConnectUdp, C> ProxyConnector<Socks, Connect, ConnectUdp, HttpForwardProxyConnector<ProxyDialer<C>>>
Sourcepub fn with_isolate_forward_proxy_auth_error(self, enabled: bool) -> Self
pub fn with_isolate_forward_proxy_auth_error(self, enabled: bool) -> Self
See HttpForwardProxyConnector::with_isolate_auth_error; disabled by default.
Sourcepub fn set_isolate_forward_proxy_auth_error(
&mut self,
enabled: bool,
) -> &mut Self
pub fn set_isolate_forward_proxy_auth_error( &mut self, enabled: bool, ) -> &mut Self
See HttpForwardProxyConnector::with_isolate_auth_error; disabled by default.
Sourcepub fn with_forward_proxy_auth(self, enabled: bool) -> Self
pub fn with_forward_proxy_auth(self, enabled: bool) -> Self
See HttpForwardProxyConnector::with_proxy_auth; enabled by default.
Sourcepub fn set_forward_proxy_auth(&mut self, enabled: bool) -> &mut Self
pub fn set_forward_proxy_auth(&mut self, enabled: bool) -> &mut Self
See HttpForwardProxyConnector::with_proxy_auth; enabled by default.
Trait Implementations§
Source§impl<Socks: Clone, Connect: Clone, ConnectUdp: Clone, Forward: Clone> Clone for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
impl<Socks: Clone, Connect: Clone, ConnectUdp: Clone, Forward: Clone> Clone for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
Source§impl<Socks: Debug, Connect: Debug, ConnectUdp: Debug, Forward: Debug> Debug for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
impl<Socks: Debug, Connect: Debug, ConnectUdp: Debug, Forward: Debug> Debug for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
Auto Trait Implementations§
impl<Socks, Connect, ConnectUdp, Forward> Forget for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
impl<Socks, Connect, ConnectUdp, Forward> Freeze for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
impl<Socks, Connect, ConnectUdp, Forward> Move for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
impl<Socks, Connect, ConnectUdp, Forward> RefUnwindSafe for ProxyConnector<Socks, Connect, ConnectUdp, Forward>where
Socks: RefUnwindSafe,
Connect: RefUnwindSafe,
ConnectUdp: RefUnwindSafe,
Forward: RefUnwindSafe,
impl<Socks, Connect, ConnectUdp, Forward> Send for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
impl<Socks, Connect, ConnectUdp, Forward> Sync for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
impl<Socks, Connect, ConnectUdp, Forward> Unpin for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
impl<Socks, Connect, ConnectUdp, Forward> UnsafeUnpin for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
impl<Socks, Connect, ConnectUdp, Forward> UnwindSafe for ProxyConnector<Socks, Connect, ConnectUdp, Forward>
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