[][src]Trait async_proxy::proxy::ProxyConstructor

pub trait ProxyConstructor {
    type Stream: Send;
    type ProxyStream: Send;
    type ErrorKind;
#[must_use]    fn connect<'async_trait>(
        self,
        stream: Self::Stream
    ) -> Pin<Box<dyn Future<Output = Result<Self::ProxyStream, Self::ErrorKind>> + Send + 'async_trait>>
    where
        Self: Sized,
        Self: 'async_trait
; }

A general trait that represents something that constructs a proxy stream, something, where we can write to and read from just as from a usual stream but through a proxy

Associated Types

type Stream: Send

Represents a stream that the proxy client operates on (sends protocol data over it)

type ProxyStream: Send

Represents the actual proxy stream, returned by the connect function

type ErrorKind

Used for internal proxy error indication

Loading content...

Required methods

#[must_use]fn connect<'async_trait>(
    self,
    stream: Self::Stream
) -> Pin<Box<dyn Future<Output = Result<Self::ProxyStream, Self::ErrorKind>> + Send + 'async_trait>> where
    Self: Sized,
    Self: 'async_trait, 

Takes ownership of an existant stream, establishes a proxixied connection on the stream and returns the proxy stream if the connection was successful, unless an error

Loading content...

Implementors

impl ProxyConstructor for Socks4General[src]

type ProxyStream = S4GeneralStream

type Stream = TcpStream

type ErrorKind = ErrorKind

impl ProxyConstructor for Socks4NoIdent[src]

type ProxyStream = S4NoIdentStream

type Stream = TcpStream

type ErrorKind = ErrorKind

impl ProxyConstructor for TcpNoAuth[src]

type Stream = TcpStream

type ProxyStream = TcpNoAuthStream

type ErrorKind = ErrorKind

Loading content...