[−][src]Struct tokio_socks::tcp::Socks5Listener
A SOCKS5 BIND client.
Once you get an instance of Socks5Listener
, you should send the
bind_addr
to the remote process via the primary connection. Then, call the
accept
function and wait for the other end connecting to the rendezvous
address.
Implementations
impl Socks5Listener<TcpStream>
[src]
pub async fn bind<'t, P, T>(
proxy: P,
target: T
) -> Result<Socks5Listener<TcpStream>> where
P: ToProxyAddrs,
T: IntoTargetAddr<'t>,
[src]
proxy: P,
target: T
) -> Result<Socks5Listener<TcpStream>> where
P: ToProxyAddrs,
T: IntoTargetAddr<'t>,
Initiates a BIND request to the specified proxy.
The proxy will filter incoming connections based on the value of
target
.
Error
It propagates the error that occurs in the conversion from T
to
TargetAddr
.
pub async fn bind_with_password<'a, 't, P, T>(
proxy: P,
target: T,
username: &'a str,
password: &'a str
) -> Result<Socks5Listener<TcpStream>> where
P: ToProxyAddrs,
T: IntoTargetAddr<'t>,
[src]
proxy: P,
target: T,
username: &'a str,
password: &'a str
) -> Result<Socks5Listener<TcpStream>> where
P: ToProxyAddrs,
T: IntoTargetAddr<'t>,
Initiates a BIND request to the specified proxy using given username and password.
The proxy will filter incoming connections based on the value of
target
.
Error
It propagates the error that occurs in the conversion from T
to
TargetAddr
.
impl<S> Socks5Listener<S> where
S: AsyncRead + AsyncWrite + Unpin,
[src]
S: AsyncRead + AsyncWrite + Unpin,
pub async fn bind_with_socket<'t, T>(
socket: S,
target: T
) -> Result<Socks5Listener<S>> where
T: IntoTargetAddr<'t>,
[src]
socket: S,
target: T
) -> Result<Socks5Listener<S>> where
T: IntoTargetAddr<'t>,
Initiates a BIND request to the specified proxy using the given socket to it.
The proxy will filter incoming connections based on the value of
target
.
Error
It propagates the error that occurs in the conversion from T
to
TargetAddr
.
pub async fn bind_with_password_and_socket<'a, 't, T>(
socket: S,
target: T,
username: &'a str,
password: &'a str
) -> Result<Socks5Listener<S>> where
T: IntoTargetAddr<'t>,
[src]
socket: S,
target: T,
username: &'a str,
password: &'a str
) -> Result<Socks5Listener<S>> where
T: IntoTargetAddr<'t>,
Initiates a BIND request to the specified proxy using given username, password and socket to the proxy.
The proxy will filter incoming connections based on the value of
target
.
Error
It propagates the error that occurs in the conversion from T
to
TargetAddr
.
pub fn bind_addr(&self) -> TargetAddr
[src]
Returns the address of the proxy-side TCP listener.
This should be forwarded to the remote process, which should open a connection to it.
pub async fn accept(__arg0: Self) -> Result<Socks5Stream<S>>
[src]
Consumes this listener, returning a Future
which resolves to the
Socks5Stream
connected to the target server through the proxy.
The value of bind_addr
should be forwarded to the remote process
before this method is called.
Auto Trait Implementations
impl<S> RefUnwindSafe for Socks5Listener<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for Socks5Listener<S> where
S: Send,
S: Send,
impl<S> Sync for Socks5Listener<S> where
S: Sync,
S: Sync,
impl<S> Unpin for Socks5Listener<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Socks5Listener<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,