Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

http-extract

Extract the signal. Keep trust explicit.

http-extract is a synchronous, framework-independent Rust library for strict HTTP request metadata extraction. Its public functions accept http crate types and return ordinary Rust values such as &str, u64, Mime, Authority, IpAddr, and Vec<IpAddr>.

One small API, one hard boundary

The library deliberately separates two kinds of information:

Request and transport factsRaw Header assertions
URI authority, Content-Type, request ID, socket peerForwarded, X-Forwarded-*, provider client-IP fields
Read through small, direct functionsParsed without silently granting trust

Forwarding fields are never trusted merely because they are present. Errors contain field names, never parser details or raw field values. Authorization credentials, API keys, cookies, bodies, complete query strings, and raw forwarding fields must not be logged.

Start here

  1. Install the crate and run a first extraction.
  2. Understand the client IP trust boundary.
  3. Find the feature and API family you need.
  4. Run the production-oriented Axum example.

The API documentation is the complete type-level reference. The exact protocol boundary is documented in Standards and compatibility.

Framework boundary

The default library core is synchronous and framework-independent. Axum is an optional, non-default dependency used only for the transport-peer extension adapter and the runnable example. The declared compiler baseline is Rust 1.96.0.