guess 0.1.5

High-performance zero-copy network protocol detection from first bytes.
Documentation

Guess

High-performance zero-copy network protocol detection with version awareness.

guess is designed for scenarios where you need to identify the application-layer protocol of a new connection as quickly as possible, typically by inspecting only the first 64 bytes of data. It supports version extraction and refined filtering for modern network stacks.

Features

  • Zero-Copy Detection: Inspects data without any heap allocation or copying, maximizing performance.
  • Version Awareness: Extracts protocol versions for HTTP (1.0, 1.1, 2.0), SSH, TLS, and Redis (RESP2/3).
  • Customizable Priority: Define your own detection chain order to optimize for your specific traffic patterns.
  • Refined Filtering: Configure detectors to only match specific protocol versions (e.g., "accept only HTTP/2.0").
  • Transport Aware: Type-safe builders tailored for TCP or UDP protocol sets.
  • No-std Support: Core detection logic works in no-std environments for embedded use.

Usage Examples

Check the examples directory for runnable code:

Installation

[dependencies]
guess = { version = "0.1", features = ["full"] }

Feature Flags

Feature Description
std Standard library support (for custom chains).
http HTTP & version extraction (1.0, 1.1, 2.0).
tls TLS (SSL) & version extraction (1.0-1.3).
ssh SSH & version extraction (1.5, 2.0).
redis Redis (RESP2/3) & version extraction.
dns DNS (UDP/TCP) headers.
quic QUIC Initial packets.
mysql MySQL server handshake.
postgres PostgreSQL startup & SSLRequest.
mqtt MQTT CONNECT packets.
smtp SMTP greeting & commands.
pop3 POP3 greeting & commands.
imap IMAP greeting & tagged commands.
ftp FTP greeting & commands.
smb SMB (v1/v2/v3) & Direct TCP.
sip SIP request & status lines.
rtsp RTSP request & status lines.
stun STUN (NAT traversal).
dhcp DHCP (BOOTP) & magic cookies.
ntp NTP (Network Time Protocol).
web Includes http, tls, quic.
db Includes mysql, postgres, redis.
tcp All common TCP-based protocols.
udp All common UDP-based protocols.
tracing Optional instrumentation using tracing crate.
full Enables all features above.

License

Released under the MIT License © 2026 Canmi