Struct socks::Socks4Socket
[−]
[src]
pub struct Socks4Socket {
// some fields omitted
}A SOCKS4 client.
Methods
impl Socks4Socket
fn connect<T, U>(proxy: T, target: U, userid: &str) -> Result<Socks4Socket> where T: ToSocketAddrs, U: ToTargetAddr
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.
fn proxy_addr(&self) -> SocketAddrV4
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 Socks4Socket, returning the inner TcpStream.