Struct SocksV4
pub struct SocksV4<C> { /* private fields */ }
Tunnel Proxy via SOCKSv4
This is a connector that can be used by the legacy::Client. It wraps
another connector, and after getting an underlying connection, it establishes
a TCP tunnel over it using SOCKSv4.
Implementations
impl<C> SocksV4<C>
fn new(proxy_dst: Uri, connector: C) -> SelfCreate a new SOCKSv4 handshake service
Wraps an underlying connector and stores the address of a tunneling proxying server.
A
SocksV4can then be called with any destination. Thedstpassed tocallwill not be used to create the underlying connection, but will be used in a SOCKS handshake with the proxy destination.fn local_dns(self, local_dns: bool) -> SelfResolve 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.
Trait Implementations
impl<C> Service<Uri> for SocksV4<C>
where
C: Service<Uri>,
C::Future: Send + 'static,
C::Response: Read + Write + Unpin + Send + 'static,
C::Error: Send + 'static,
type Response = <C as Service<Uri>>::Response;type Error = SocksError<<C as Service<Uri>>::Error>;type Future = Handshaking<<C as Service<Uri>>::Future, <C as Service<Uri>>::Response, <C as Service<Uri>>::Error>;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>fn call(&mut self, dst: Uri) -> Self::Future
impl<C: Clone> Clone for SocksV4<C>
fn clone(&self) -> Self
impl<C: Debug> Debug for SocksV4<C>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<C> !Freeze for SocksV4<C>
impl<C> RefUnwindSafe for SocksV4<C>
where
C: RefUnwindSafe,
impl<C> Send for SocksV4<C>
where
C: Send,
impl<C> Sync for SocksV4<C>
where
C: Sync,
impl<C> Unpin for SocksV4<C>
where
C: Unpin,
impl<C> UnsafeUnpin for SocksV4<C>
where
C: UnsafeUnpin,
impl<C> UnwindSafe for SocksV4<C>
where
C: UnwindSafe,
Blanket Implementations
impl<S, T> Connect for SocksV4<C>
where
S: Service<Uri, Response = T> + Send + 'static,
<S as Service<Uri>>::Error: Into<Box<dyn Error + Sync + Send>>,
<S as Service<Uri>>::Future: Unpin + Send,
T: Read + Write + Connection + Unpin + Send + 'static,
type _Svc = S;fn connect(self, Internal, dst: Uri) -> Oneshot<S, Uri>
impl<T> Any for SocksV4<C>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for SocksV4<C>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for SocksV4<C>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for SocksV4<C>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for SocksV4<C>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for SocksV4<C>
impl<T> ToOwned for SocksV4<C>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> WithSubscriber for SocksV4<C>
impl<T, U> Into<U> for SocksV4<C>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for SocksV4<C>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for SocksV4<C>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>