pub struct SocksDatagram<S> { /* private fields */ }
Expand description
A UDP socket that sends packets through a proxy.
Implementations§
Source§impl<S> SocksDatagram<S>
impl<S> SocksDatagram<S>
Sourcepub async fn udp_associate(
stream: S,
socket: UdpSocket,
auth: Option<UserKey>,
) -> Result<Self>
pub async fn udp_associate( stream: S, socket: UdpSocket, auth: Option<UserKey>, ) -> Result<Self>
Creates SocksDatagram
. Performs UDP ASSOCIATE
under the hood.
Sourcepub fn proxy_addr(&self) -> &Address
pub fn proxy_addr(&self) -> &Address
Returns the address of the associated udp address.
Sourcepub fn get_mut(&mut self) -> &mut UdpSocket
pub fn get_mut(&mut self) -> &mut UdpSocket
Returns a mutable reference to the underlying udp socket.
Sourcepub fn into_inner(self) -> (S, UdpSocket)
pub fn into_inner(self) -> (S, UdpSocket)
Returns the associated stream and udp socket.
pub async fn build_socks5_udp_datagram( buf: &[u8], addr: &Address, ) -> Result<Vec<u8>>
Trait Implementations§
Auto Trait Implementations§
impl<S> !Freeze for SocksDatagram<S>
impl<S> RefUnwindSafe for SocksDatagram<S>where
S: RefUnwindSafe,
impl<S> Send for SocksDatagram<S>where
S: Send,
impl<S> Sync for SocksDatagram<S>where
S: Sync,
impl<S> Unpin for SocksDatagram<S>where
S: Unpin,
impl<S> UnwindSafe for SocksDatagram<S>where
S: UnwindSafe,
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