Struct shadowsocks_service::local::socks::socks4::HandshakeRequest
source · [−]Expand description
Handshake Request
The client connects to the SOCKS server and sends a CONNECT/BIND request when
it wants to establish a connection to an application server. The client
includes in the request packet the IP address and the port number of the
destination host, and userid, in the following format.
+----+----+----+----+----+----+----+----+----+----+....+----+
| VN | CD | DSTPORT | DSTIP | USERID |NULL|
+----+----+----+----+----+----+----+----+----+----+....+----+
VN is the SOCKS protocol version number and should be 4. CD is the
SOCKS command code and should be 1 for CONNECT request, 2 for BIND request. NULL is a byte
of all zero bits.
Fields
cd: Command
dst: Address
user_id: Vec<u8>
Implementations
pub async fn read_from<R>(r: &mut R) -> Result<HandshakeRequest, Error> where
R: AsyncBufRead + Unpin,
pub async fn read_from<R>(r: &mut R) -> Result<HandshakeRequest, Error> where
R: AsyncBufRead + Unpin,
Read from a reader
Writes to writer
Writes to buffer
Length in bytes
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for HandshakeRequest
impl Send for HandshakeRequest
impl Sync for HandshakeRequest
impl Unpin for HandshakeRequest
impl UnwindSafe for HandshakeRequest
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more