[][src]Struct fast_socks5::client::Socks5Stream

pub struct Socks5Stream<S: AsyncRead + AsyncWrite + Unpin> { /* fields omitted */ }

A SOCKS5 client. Socks5Stream implements AsyncRead and AsyncWrite.

Methods

impl<S> Socks5Stream<S> where
    S: AsyncRead + AsyncWrite + Unpin
[src]

pub async fn use_stream(
    socket: S,
    target_addr: TargetAddr,
    auth: Option<AuthenticationMethod>,
    config: Config
) -> Result<Self>
[src]

Possibility to use a stream already created rather than creating a whole new TcpStream::connect().

impl Socks5Stream<TcpStream>[src]

Api if you want to use TcpStream to create a new connection to the SOCKS5 server.

pub async fn connect<T>(
    socks_server: T,
    target_addr: String,
    target_port: u16,
    config: Config
) -> Result<Self> where
    T: ToSocketAddrs
[src]

Connects to a target server through a SOCKS5 proxy.

pub async fn connect_with_password<T>(
    socks_server: T,
    target_addr: String,
    target_port: u16,
    username: String,
    password: String,
    config: Config
) -> Result<Self> where
    T: ToSocketAddrs
[src]

Connect with credentials

Trait Implementations

impl<S> AsyncRead for Socks5Stream<S> where
    S: AsyncRead + AsyncWrite + Unpin
[src]

Allow us to read directly from the struct

impl<S> AsyncWrite for Socks5Stream<S> where
    S: AsyncRead + AsyncWrite + Unpin
[src]

Allow us to write directly into the struct

impl<S: Debug + AsyncRead + AsyncWrite + Unpin> Debug for Socks5Stream<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for Socks5Stream<S> where
    S: RefUnwindSafe

impl<S> Send for Socks5Stream<S> where
    S: Send

impl<S> Sync for Socks5Stream<S> where
    S: Sync

impl<S> Unpin for Socks5Stream<S>

impl<S> UnwindSafe for Socks5Stream<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?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> ReadExt for T where
    T: AsyncRead + ?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<T> WriteExt for T where
    T: AsyncWrite + ?Sized
[src]