Struct SocksV5

struct SocksV5<C> { ... }

Tunnel Proxy via SOCKSv5

This is a connector that can be used by the legacy::Client. It wraps another connector, and after getting an underlying connection, it established a TCP tunnel over it using SOCKSv5.

Implementations

impl<C> SocksV5<C>

fn new(proxy_dst: Uri, connector: C) -> Self

Create a new SOCKSv5 handshake service.

Wraps an underlying connector and stores the address of a tunneling proxying server.

A SocksV5 can then be called with any destination. The dst passed to call will not be used to create the underlying connection, but will be used in a SOCKS handshake with the proxy destination.

fn with_auth(self: Self, user: String, pass: String) -> Self

Use User/Pass authentication method during handshake.

Username and Password must be maximum of 255 characters each. 0 length strings are allowed despite RFC prohibiting it. This is done so that for compatablity with server implementations that require it for IP authentication.

fn local_dns(self: Self, local_dns: bool) -> Self

Resolve domain names locally on the client, rather than on the proxy server.

Disabled by default as local resolution of domain names can be detected as a DNS leak.

fn send_optimistically(self: Self, optimistic: bool) -> Self

Send all messages of the handshake optmistically (without waiting for server response).

Typical SOCKS handshake with auithentication takes 3 round trips. Optimistic sending can reduce round trip times and dramatically increase speed of handshake at the cost of reduced portability; many server implementations do not support optimistic sending as it is not defined in the RFC (RFC 1928).

Recommended to ensure connector works correctly without optimistic sending before trying with optimistic sending.

impl<C> Freeze for SocksV5<C>

impl<C> RefUnwindSafe for SocksV5<C>

impl<C> Send for SocksV5<C>

impl<C> Service for SocksV5<C>

fn poll_ready(self: &mut Self, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>
fn call(self: &mut Self, dst: Uri) -> <Self as >::Future

impl<C> Sync for SocksV5<C>

impl<C> Unpin for SocksV5<C>

impl<C> UnsafeUnpin for SocksV5<C>

impl<C> UnwindSafe for SocksV5<C>

impl<C: $crate::clone::Clone> Clone for SocksV5<C>

fn clone(self: &Self) -> SocksV5<C>

impl<C: $crate::fmt::Debug> Debug for SocksV5<C>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<T> Any for SocksV5<C>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for SocksV5<C>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for SocksV5<C>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for SocksV5<C>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for SocksV5<C>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for SocksV5<C>

impl<T> ToOwned for SocksV5<C>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> WithSubscriber for SocksV5<C>

impl<T, U> Into for SocksV5<C>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for SocksV5<C>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for SocksV5<C>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>