socker 1.0.0

Sans-IO SOCKS4, SOCKS4a, SOCKS5 and SOCKS5h protocol implementation
Documentation
//! 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.

pub mod messages;
pub mod types;

pub use messages::{
    Request,
    Response,
};
pub use types::{
    Address,
    CommandType,
    Reply,
};

/// The SOCKS4 protocol version byte (`VN`) of client requests.
pub const REQUEST_VERSION: u8 = 0x04;

/// The version byte (`VN`) of SOCKS4 server responses; the classic protocol
/// replies with a NUL here rather than with the request version.
pub const RESPONSE_VERSION: u8 = 0x00;

#[cfg(test)]
mod tests;