[][src]Struct socks::Socks4Stream

pub struct Socks4Stream { /* fields omitted */ }

A SOCKS4 client.

Implementations

impl Socks4Stream[src]

pub fn connect<T, U>(proxy: T, target: U, userid: &str) -> Result<Socks4Stream> where
    T: ToSocketAddrs,
    U: ToTargetAddr
[src]

Connects to a target server through a SOCKS4 proxy.

Note

If target is a TargetAddr::Domain, the domain name will be forwarded to the proxy server using the SOCKS4A protocol extension. If the proxy server does not support SOCKS4A, consider performing the DNS lookup locally and passing a TargetAddr::Ip.

pub fn proxy_addr(&self) -> SocketAddrV4[src]

Returns the proxy-side address of the connection between the proxy and target server.

pub fn get_ref(&self) -> &TcpStream[src]

Returns a shared reference to the inner TcpStream.

pub fn get_mut(&mut self) -> &mut TcpStream[src]

Returns a mutable reference to the inner TcpStream.

pub fn into_inner(self) -> TcpStream[src]

Consumes the Socks4Stream, returning the inner TcpStream.

Trait Implementations

impl Debug for Socks4Stream[src]

impl Read for Socks4Stream[src]

impl<'a> Read for &'a Socks4Stream[src]

impl Write for Socks4Stream[src]

impl<'a> Write for &'a Socks4Stream[src]

Auto Trait Implementations

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> From<T> for T[src]

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

impl<R> ReadBytesExt for R where
    R: Read + ?Sized
[src]

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<W> WriteBytesExt for W where
    W: Write + ?Sized
[src]