[][src]Struct tari_comms::socks::Socks5Client

pub struct Socks5Client<TSocket> { /* fields omitted */ }

A SOCKS5 socket connection.

Implementations

impl<TSocket> Socks5Client<TSocket> where
    TSocket: AsyncRead + AsyncWrite + Unpin
[src]

pub fn new(socket: TSocket) -> Self[src]

Create a new socks5 client with a socket already connected to the target proxy

pub fn with_authentication(
    &mut self,
    auth: Authentication
) -> Result<&mut Self, SocksError>
[src]

pub async fn connect(
    self,
    address: &Multiaddr
) -> Result<(TSocket, Multiaddr), SocksError>
[src]

Connects to a address through a SOCKS5 proxy and returns the 'upgraded' socket. This consumes the Socks5Client as once connected, the socks protocol does not recognise any further commands.

pub async fn tor_resolve(
    &mut self,
    address: &Multiaddr
) -> Result<Multiaddr, SocksError>
[src]

Requests the tor proxy to resolve a DNS address is resolved into an IP address. This operation only works with the tor SOCKS proxy.

pub async fn tor_resolve_ptr(
    &mut self,
    address: &Multiaddr
) -> Result<Multiaddr, SocksError>
[src]

Requests the tor proxy to reverse resolve an IP address into a DNS address if it is able. This operation only works with the tor SOCKS proxy.

Auto Trait Implementations

impl<TSocket> RefUnwindSafe for Socks5Client<TSocket> where
    TSocket: RefUnwindSafe
[src]

impl<TSocket> Send for Socks5Client<TSocket> where
    TSocket: Send
[src]

impl<TSocket> Sync for Socks5Client<TSocket> where
    TSocket: Sync
[src]

impl<TSocket> Unpin for Socks5Client<TSocket> where
    TSocket: Unpin
[src]

impl<TSocket> UnwindSafe for Socks5Client<TSocket> where
    TSocket: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> From<T> for T[src]

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,