pub struct Socks6Client { /* private fields */ }
Expand description
Represents a SOCKS6 client.
Implementations§
Source§impl Socks6Client
impl Socks6Client
Sourcepub async fn new<A: Into<String>>(
proxy_addr: A,
credentials: Option<Credentials>,
) -> Result<Self>
pub async fn new<A: Into<String>>( proxy_addr: A, credentials: Option<Credentials>, ) -> Result<Self>
Sourcepub async fn connect<A>(
&self,
destination: A,
initial_data: Option<Vec<u8>>,
options: Option<Vec<SocksOption>>,
) -> Result<(TcpStream, Address)>
pub async fn connect<A>( &self, destination: A, initial_data: Option<Vec<u8>>, options: Option<Vec<SocksOption>>, ) -> Result<(TcpStream, Address)>
Sourcepub async fn handshake<A>(
&self,
destination: A,
initial_data: Option<Vec<u8>>,
options: Option<Vec<SocksOption>>,
stream: &mut TcpStream,
) -> Result<Address>
pub async fn handshake<A>( &self, destination: A, initial_data: Option<Vec<u8>>, options: Option<Vec<SocksOption>>, stream: &mut TcpStream, ) -> Result<Address>
Conducts the handshake process with the SOCKS6 proxy.
This method implements the handshake protocol as per [socks6-draft11]. [socks6-draft11]: https://tools.ietf.org/html/draft-olteanu-intarea-socks-6-11
§Parameters
destination
: The destination to connect to.initial_data
: Optional initial data to send.options
: Optional SOCKS options.stream
: The mutable reference to theTcpStream
.
§Returns
A Result
containing the bound Address
or an error.
Trait Implementations§
Source§impl Clone for Socks6Client
impl Clone for Socks6Client
Source§fn clone(&self) -> Socks6Client
fn clone(&self) -> Socks6Client
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for Socks6Client
impl RefUnwindSafe for Socks6Client
impl Send for Socks6Client
impl Sync for Socks6Client
impl Unpin for Socks6Client
impl UnwindSafe for Socks6Client
Blanket Implementations§
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