How omjadas/hudsucker works
Hudsucker is a Rust MITM HTTP/S proxy. Its principal workflow accepts client connections, dispatches requests for HTTP forwarding or CONNECT/WebSocket interception, lets configured handlers modify traffic, and returns the result to the client. Certificate authorities provide per-host TLS server configuration; optional decoder helpers and the shared body type support handler-level message processing. The excerpts show the runtime entry and portions of dispatch, but omit some forwarding details, so uncertain wiring is left out.
Main entry points: internal.rs Connection dispatch · lib.rs HTTP handler · certificate_authority/mod.rs Certificate authority · proxy/mod.rs Proxy server
Components 16
Proxy runtime
- Proxy builder
src/proxy/builder.rs - Proxy server
src/proxy/mod.rs
Traffic handling
- Connection dispatch
src/proxy/internal.rs - HTTP handler
src/lib.rs - WebSocket handler
src/lib.rs - HTTP connector
src/proxy/builder.rs - No-op handler
src/noop.rs
Certificate issuance
- Certificate authority
src/certificate_authority/mod.rs - Rcgen authority
src/certificate_authority/rcgen_authority.rs - OpenSSL authority
src/certificate_authority/openssl_authority.rs
Message utilities
- HTTP body
src/body.rs - Body decoder
src/decoder.rs - Body rewind
src/rewind.rs - Body tee
src/tee.rs
Other components
- Proxy client
- Upstream server
Connections 19
- Proxy client → Proxy server: connects
- Proxy builder → Proxy server: builds
- Proxy server → Connection dispatch: dispatches
- Connection dispatch → HTTP handler: invokes
- Connection dispatch → HTTP connector: forwards HTTP
- HTTP connector → Upstream server: sends request
- Connection dispatch → Upstream server: opens tunnel
- Connection dispatch → Certificate authority: requests TLS config
- Certificate authority → Rcgen authority: implemented by
- Certificate authority → OpenSSL authority: implemented by
- Connection dispatch → WebSocket handler: forwards messages
- HTTP handler → HTTP body: handles bodies
- WebSocket handler → Proxy client: returns messages
- Upstream server → Connection dispatch: returns traffic
- Connection dispatch → Proxy client: returns response
- HTTP handler → Body decoder: may decode
- Proxy builder → No-op handler: defaults handlers
- Connection dispatch → Body rewind
- Connection dispatch → Body tee