[−][src]Trait async_proxy::proxy::ProxyStream
General trait which implementing type represents an asyncronous proxy client (stream)
Associated Types
type Stream: IOStream
Represents a stream that the proxy client operates on (sends protocol data over it)
type ErrorKind
Used for internal proxy error indication
type ConnParams
Parameters that are passed to the connect function.
Each proxification protocol requires own parameters in a client implementation, so the implementing type must annotate it.
For instance, a Socks4 protocol implementation may require (if it is flexible it will actually require) destanation IPv4 address and port, while an HTTP(s) protocol implementation may require you a destanation URI
Required methods
#[must_use]fn connect<'async_trait>(
stream: Self::Stream,
params: Self::ConnParams
) -> Pin<Box<dyn Future<Output = Result<Self, Self::ErrorKind>> + Send + 'async_trait>> where
Self: Sized,
Self: 'async_trait,
stream: Self::Stream,
params: Self::ConnParams
) -> Pin<Box<dyn Future<Output = Result<Self, Self::ErrorKind>> + Send + 'async_trait>> where
Self: Sized,
Self: 'async_trait,
Takes ownership of an existant stream and
establishes on it connection.
Returns a ProxyStream
if the connection
was successful, an error if not.
Implementors
impl ProxyStream for Socks4General
[src]
type Stream = TcpStream
type ErrorKind = ErrorKind
type ConnParams = ConnParams
fn connect<'async_trait>(
stream: Self::Stream,
params: Self::ConnParams
) -> Pin<Box<dyn Future<Output = Result<Self, Self::ErrorKind>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
stream: Self::Stream,
params: Self::ConnParams
) -> Pin<Box<dyn Future<Output = Result<Self, Self::ErrorKind>> + Send + 'async_trait>> where
Self: 'async_trait,