Struct electrum_client::socks::Socks5Listener
source · pub struct Socks5Listener(_);
Expand description
A SOCKS5 BIND client.
Implementations§
source§impl Socks5Listener
impl Socks5Listener
sourcepub fn bind<T, U>(
proxy: T,
target: U,
timeout: Option<Duration>
) -> Result<Socks5Listener>where
T: ToSocketAddrs,
U: ToTargetAddr,
pub fn bind<T, U>( proxy: T, target: U, timeout: Option<Duration> ) -> Result<Socks5Listener>where T: ToSocketAddrs, U: ToTargetAddr,
Initiates a BIND request to the specified proxy.
The proxy will filter incoming connections based on the value of
target
.
sourcepub fn bind_with_password<T, U>(
proxy: T,
target: U,
username: &str,
password: &str,
timeout: Option<Duration>
) -> Result<Socks5Listener>where
T: ToSocketAddrs,
U: ToTargetAddr,
pub fn bind_with_password<T, U>( proxy: T, target: U, username: &str, password: &str, timeout: Option<Duration> ) -> Result<Socks5Listener>where T: ToSocketAddrs, U: ToTargetAddr,
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
.
sourcepub fn proxy_addr(&self) -> &TargetAddr
pub fn proxy_addr(&self) -> &TargetAddr
The address of the proxy-side TCP listener.
This should be forwarded to the remote process, which should open a connection to it.
sourcepub fn accept(self) -> Result<Socks5Stream>
pub fn accept(self) -> Result<Socks5Stream>
Waits for the remote process to connect to the proxy server.
The value of proxy_addr
should be forwarded to the remote process
before this method is called.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Socks5Listener
impl Send for Socks5Listener
impl Sync for Socks5Listener
impl Unpin for Socks5Listener
impl UnwindSafe for Socks5Listener
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more