Struct socks::Socks5Stream [] [src]

pub struct Socks5Stream {
    // some fields omitted
}

A SOCKS5 client.

Methods

impl Socks5Stream

fn connect<T, U>(proxy: T, target: U) -> Result<Socks5Stream> where T: ToSocketAddrs, U: ToTargetAddr

Connects to a target server through a SOCKS5 proxy.

fn proxy_addr(&self) -> SocketAddr

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

fn get_ref(&self) -> &TcpStream

Returns a shared reference to the inner TcpStream.

fn get_mut(&mut self) -> &mut TcpStream

Returns a mutable reference to the inner TcpStream.

fn into_inner(self) -> TcpStream

Consumes the Socks4Stream, returning the inner TcpStream.

Trait Implementations

impl Read for Socks5Stream

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn bytes(self) -> Bytes<Self>

fn chars(self) -> Chars<Self>

fn chain<R>(self, next: R) -> Chain<Self, R> where R: Read

fn take(self, limit: u64) -> Take<Self>

fn tee<W>(self, out: W) -> Tee<Self, W> where W: Write

impl<'a> Read for &'a Socks5Stream

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn bytes(self) -> Bytes<Self>

fn chars(self) -> Chars<Self>

fn chain<R>(self, next: R) -> Chain<Self, R> where R: Read

fn take(self, limit: u64) -> Take<Self>

fn tee<W>(self, out: W) -> Tee<Self, W> where W: Write

impl Write for Socks5Stream

fn write(&mut self, buf: &[u8]) -> Result<usize>

fn flush(&mut self) -> Result<()>

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn broadcast<W>(self, other: W) -> Broadcast<Self, W> where W: Write

impl<'a> Write for &'a Socks5Stream

fn write(&mut self, buf: &[u8]) -> Result<usize>

fn flush(&mut self) -> Result<()>

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn broadcast<W>(self, other: W) -> Broadcast<Self, W> where W: Write

Derived Implementations

impl Debug for Socks5Stream

fn fmt(&self, __arg_0: &mut Formatter) -> Result