Struct Socks5ConnectProxyConnector
pub struct Socks5ConnectProxyConnector<S> { /* private fields */ }socks5 only.Expand description
A connector which establishes a tunnel over a SOCKS5 proxy.
A proxy is required: a request without a proxied ProxyRoute fails. Pair it with
MaybeProxiedConnector to connect directly instead when no proxy is requested.
The inner service dials the connection to the proxy, such as a ProxyDialer
over the connector towards proxies. The SOCKS5 handshake for the requested
target is spoken over the connection it returns.
Implementations§
§impl<S> Socks5ConnectProxyConnector<ProxyDialer<S>>
impl<S> Socks5ConnectProxyConnector<ProxyDialer<S>>
pub fn new(inner: S) -> Socks5ConnectProxyConnector<ProxyDialer<S>>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn new(inner: S) -> Socks5ConnectProxyConnector<ProxyDialer<S>>
dns and http-backend and http and std and tcp only.Creates a new Socks5ConnectProxyConnector over the given connector towards the proxy.
§impl<S> Socks5ConnectProxyConnector<S>
impl<S> Socks5ConnectProxyConnector<S>
pub fn from_dialer(dialer: S) -> Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn from_dialer(dialer: S) -> Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Creates a new Socks5ConnectProxyConnector over the connections to the proxy that
dialer dials, see ProxyDialer.
pub fn with_extensions_transfer(
self,
transfer: impl ExtensionsTransfer,
) -> Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn with_extensions_transfer( self, transfer: impl ExtensionsTransfer, ) -> Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Set what a SOCKS5 tunnel keeps from the proxy connection it is nested on.
Defaults to DefaultExtensionsTransfer. Chain transfers with
ExtensionsTransfer::and to also carry your own connection-scoped
extension types across the tunnel.
pub fn set_extensions_transfer(
&mut self,
transfer: impl ExtensionsTransfer,
) -> &mut Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn set_extensions_transfer( &mut self, transfer: impl ExtensionsTransfer, ) -> &mut Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Set what a SOCKS5 tunnel keeps from the proxy connection it is nested on.
Defaults to DefaultExtensionsTransfer. Chain transfers with
ExtensionsTransfer::and to also carry your own connection-scoped
extension types across the tunnel.
pub fn get_ref(&self) -> &S
Available on crate features dns and http-backend and http and std and tcp only.
pub fn get_ref(&self) -> &S
dns and http-backend and http and std and tcp only.Gets a reference to the underlying service.
pub fn into_inner(self) -> S
Available on crate features dns and http-backend and http and std and tcp only.
pub fn into_inner(self) -> S
dns and http-backend and http and std and tcp only.Consumes self, returning the underlying service.
§impl<S> Socks5ConnectProxyConnector<S>
impl<S> Socks5ConnectProxyConnector<S>
pub fn with_default_dns_resolver(self) -> Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn with_default_dns_resolver(self) -> Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Attach the default DnsAddressResolver to this Socks5ConnectProxyConnector.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn set_default_dns_resolver(
&mut self,
) -> &mut Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn set_default_dns_resolver( &mut self, ) -> &mut Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Attach the default DnsAddressResolver to this Socks5ConnectProxyConnector.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn maybe_with_dns_resolver(
self,
resolver: Option<BoxDnsAddressResolver>,
) -> Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn maybe_with_dns_resolver( self, resolver: Option<BoxDnsAddressResolver>, ) -> Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Attach a DnsAddressResolver to this Socks5ConnectProxyConnector.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn maybe_set_dns_resolver(
&mut self,
resolver: Option<BoxDnsAddressResolver>,
) -> &mut Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn maybe_set_dns_resolver( &mut self, resolver: Option<BoxDnsAddressResolver>, ) -> &mut Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Attach a DnsAddressResolver to this Socks5ConnectProxyConnector.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn with_dns_resolver(
self,
resolver: BoxDnsAddressResolver,
) -> Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn with_dns_resolver( self, resolver: BoxDnsAddressResolver, ) -> Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Attach a DnsAddressResolver to this Socks5ConnectProxyConnector.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn set_dns_resolver(
&mut self,
resolver: BoxDnsAddressResolver,
) -> &mut Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn set_dns_resolver( &mut self, resolver: BoxDnsAddressResolver, ) -> &mut Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Attach a DnsAddressResolver to this Socks5ConnectProxyConnector.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn without_dns_resolver(self) -> Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn without_dns_resolver(self) -> Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Attach a DnsAddressResolver to this Socks5ConnectProxyConnector.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn unset_dns_resolver(&mut self) -> &mut Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn unset_dns_resolver(&mut self) -> &mut Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Attach a DnsAddressResolver to this Socks5ConnectProxyConnector.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn with_dns_address_resolver(
self,
resolver: impl DnsAddressResolver,
) -> Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn with_dns_address_resolver( self, resolver: impl DnsAddressResolver, ) -> Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Attach a DnsAddressResolver to this Socks5ConnectProxyConnector.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
pub fn set_dns_address_resolver(
&mut self,
resolver: impl DnsAddressResolver,
) -> &mut Socks5ConnectProxyConnector<S>
Available on crate features dns and http-backend and http and std and tcp only.
pub fn set_dns_address_resolver( &mut self, resolver: impl DnsAddressResolver, ) -> &mut Socks5ConnectProxyConnector<S>
dns and http-backend and http and std and tcp only.Attach a DnsAddressResolver to this Socks5ConnectProxyConnector.
It will try to be used (best-effort) to resolve domain addresses
as IP addresses if the socks5 protocol is used, but not for the socks5h protocol.
In case of an error with resolving the domain address the connector will anyway use the domain instead of the ip.
Trait Implementations§
§impl<S> Clone for Socks5ConnectProxyConnector<S>where
S: Clone,
impl<S> Clone for Socks5ConnectProxyConnector<S>where
S: Clone,
§fn clone(&self) -> Socks5ConnectProxyConnector<S>
fn clone(&self) -> Socks5ConnectProxyConnector<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 Socks5ConnectProxyConnector<S>where
S: Debug,
impl<S> Debug for Socks5ConnectProxyConnector<S>where
S: Debug,
§impl<S> ExtensionsRef for Socks5ConnectProxyConnector<S>where
S: ExtensionsRef,
impl<S> ExtensionsRef for Socks5ConnectProxyConnector<S>where
S: ExtensionsRef,
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Extensions store§impl<S, Input> Service<Input> for Socks5ConnectProxyConnector<S>where
S: ConnectorService<ProxyDialRequest>,
<S as ConnectorService<ProxyDialRequest>>::Connection: Io + Unpin,
Input: ConnectorTargetInputExt + ConnectorTransportProtocolInputExt + Send + 'static,
impl<S, Input> Service<Input> for Socks5ConnectProxyConnector<S>where
S: ConnectorService<ProxyDialRequest>,
<S as ConnectorService<ProxyDialRequest>>::Connection: Io + Unpin,
Input: ConnectorTargetInputExt + ConnectorTransportProtocolInputExt + Send + 'static,
§type Output = EstablishedClientConnection<NestedConnection<<S as ConnectorService<ProxyDialRequest>>::Connection>, Input>
type Output = EstablishedClientConnection<NestedConnection<<S as ConnectorService<ProxyDialRequest>>::Connection>, Input>
§type Error = ConnectionError
type Error = ConnectionError
§async fn serve(
&self,
input: Input,
) -> Result<<Socks5ConnectProxyConnector<S> as Service<Input>>::Output, <Socks5ConnectProxyConnector<S> as Service<Input>>::Error>
async fn serve( &self, input: Input, ) -> Result<<Socks5ConnectProxyConnector<S> as Service<Input>>::Output, <Socks5ConnectProxyConnector<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> !RefUnwindSafe for Socks5ConnectProxyConnector<S>
impl<S> !UnwindSafe for Socks5ConnectProxyConnector<S>
impl<S> Forget for Socks5ConnectProxyConnector<S>
impl<S> Freeze for Socks5ConnectProxyConnector<S>where
S: Freeze,
impl<S> Move for Socks5ConnectProxyConnector<S>
impl<S> Send for Socks5ConnectProxyConnector<S>where
S: Send,
impl<S> Sync for Socks5ConnectProxyConnector<S>where
S: Sync,
impl<S> Unpin for Socks5ConnectProxyConnector<S>where
S: Unpin,
impl<S> UnsafeUnpin for Socks5ConnectProxyConnector<S>where
S: UnsafeUnpin,
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> ForwardedClientExt for Twhere
T: ExtensionsRef + ?Sized,
impl<T> ForwardedClientExt for Twhere
T: ExtensionsRef + ?Sized,
§fn trusted_forwarded(&self) -> Option<&Forwarded>
fn trusted_forwarded(&self) -> Option<&Forwarded>
§fn forwarded_client(&self) -> Option<&ForwardedElement>
fn forwarded_client(&self) -> Option<&ForwardedElement>
§fn forwarded_client_ip(&self) -> Option<IpAddr>
fn forwarded_client_ip(&self) -> Option<IpAddr>
for node.§fn forwarded_client_socket_addr(&self) -> Option<SocketAddress>
fn forwarded_client_socket_addr(&self) -> Option<SocketAddress>
for node.§fn forwarded_client_host(&self) -> Option<&ForwardedAuthority>
fn forwarded_client_host(&self) -> Option<&ForwardedAuthority>
§fn forwarded_client_proto(&self) -> Option<ForwardedProtocol>
fn forwarded_client_proto(&self) -> Option<ForwardedProtocol>
§fn forwarded_client_version(&self) -> Option<ForwardedVersion>
fn forwarded_client_version(&self) -> Option<ForwardedVersion>
§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