Skip to main content

Module socks4

Module socks4 

Source
Expand description

Sans-IO implementation of SOCKS4 and SOCKS4a.

SOCKS4 is the classic, pre-RFC protocol: a single request/response exchange over TCP with a NUL-terminated user identifier, supporting the CONNECT and BIND commands. SOCKS4a extends it with a trailing domain name so that DNS resolution can be deferred to the server - the direct ancestor of the SOCKS5h mode.

As with crate::socks5, this module only encodes and decodes messages; it does not impose a state machine on the caller.

Re-exports§

pub use messages::Request;
pub use messages::Response;
pub use types::Address;
pub use types::CommandType;
pub use types::Reply;

Modules§

messages
The SOCKS4 request/response pair, covering the SOCKS4a extension.
types
SOCKS4 wire types: the caret-encoded command and reply numbers and the Address type shared by both messages.

Constants§

REQUEST_VERSION
The SOCKS4 protocol version byte (VN) of client requests.
RESPONSE_VERSION
The version byte (VN) of SOCKS4 server responses; the classic protocol replies with a NUL here rather than with the request version.