[][src]Struct socks::Socks5Datagram

pub struct Socks5Datagram { /* fields omitted */ }

A SOCKS5 UDP client.

Implementations

impl Socks5Datagram[src]

pub fn bind<T, U>(proxy: T, addr: U) -> Result<Socks5Datagram> where
    T: ToSocketAddrs,
    U: ToSocketAddrs
[src]

Creates a UDP socket bound to the specified address which will have its traffic routed through the specified proxy.

pub fn bind_with_password<T, U>(
    proxy: T,
    addr: U,
    username: &str,
    password: &str
) -> Result<Socks5Datagram> where
    T: ToSocketAddrs,
    U: ToSocketAddrs
[src]

Creates a UDP socket bound to the specified address which will have its traffic routed through the specified proxy. The given username and password is used to authenticate to the SOCKS proxy.

pub fn send_to<A>(&self, buf: &[u8], addr: A) -> Result<usize> where
    A: ToTargetAddr
[src]

Like UdpSocket::send_to.

Note

The SOCKS protocol inserts a header at the beginning of the message. The header will be 10 bytes for an IPv4 address, 22 bytes for an IPv6 address, and 7 bytes plus the length of the domain for a domain address.

pub fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, TargetAddr)>[src]

Like UdpSocket::recv_from.

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

Returns the address of the proxy-side UDP socket through which all messages will be routed.

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

Returns a shared reference to the inner socket.

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

Returns a mutable reference to the inner socket.

Trait Implementations

impl Debug for Socks5Datagram[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<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.