Struct Socks5Client
pub struct Socks5Client { /* private fields */ }Expand description
Socks5 client implementation of RFC 1928
Implementations§
§impl Client
impl Client
pub fn with_auth(self, auth: impl Into<Socks5Auth>) -> Client
pub fn with_auth(self, auth: impl Into<Socks5Auth>) -> Client
Set the Socks5Auth to be used by this client.
pub fn set_auth(&mut self, auth: impl Into<Socks5Auth>) -> &mut Client
pub fn set_auth(&mut self, auth: impl Into<Socks5Auth>) -> &mut Client
Set the Socks5Auth to be used by this client.
§impl Client
impl Client
pub async fn handshake_connect<S>(
&self,
stream: &mut S,
destination: &Authority,
) -> Result<Authority, HandshakeError>
pub async fn handshake_connect<S>( &self, stream: &mut S, destination: &Authority, ) -> Result<Authority, HandshakeError>
Establish a connection with a Socks5 server making use of the Command::Connect flow.
In case the handshake was sucessfull it will return
the local address used by the Socks5 (proxy) server
to connect to the destination Authority on behalf of this Client.
pub async fn handshake_bind<S>(
&self,
stream: S,
requested_bind_address: Option<SocketAddress>,
) -> Result<Binder<S>, HandshakeError>
pub async fn handshake_bind<S>( &self, stream: S, requested_bind_address: Option<SocketAddress>, ) -> Result<Binder<S>, HandshakeError>
Establish a connection with a Socks5 server making use of the Command::Bind flow.
Usually you do not request a bind address yourself, but for some special-purpose or local setups it might be desired that the client requests a specific bind interface to the server.
Note that the server is free to ignore this request, even when requested.
You can use Binder::selected_bind_address to compare it with Binder::requested_bind_address
in case your special purpose use-case requires the client’s bind address choice to be respected.
This method returns a Binder that contains the address to which the target server
is to connect to the socks5 server on behalf of the client (callee of this call).
The Binder takes ownership over of the input Stream such that it can
await the established connection from target server to socks5 server.
pub async fn handshake_udp<S>(
&self,
stream: S,
) -> Result<UdpSocketRelayBinder<S>, HandshakeError>
pub async fn handshake_udp<S>( &self, stream: S, ) -> Result<UdpSocketRelayBinder<S>, HandshakeError>
Establish a connection with a Socks5 server making use of the Command::UdpAssociate flow.
This method returns a UdpSocketRelayBinder that can be used
to bind to an interface as to get a [UdpSocketRelay] ready to to send udp packets through
socks5 proxy server to the required.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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<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> 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