Files
zerogravity/src/mitm/mod.rs

20 lines
789 B
Rust

//! MITM proxy module: intercepts LS ↔ Google/Anthropic API traffic.
//!
//! The LS (Go binary with BoringCrypto) respects `HTTPS_PROXY` and `SSL_CERT_FILE`.
//! By setting these env vars via the wrapper script, we route all outbound HTTPS
//! traffic through our local MITM proxy, which:
//!
//! 1. Terminates TLS using dynamically-generated per-domain certificates
//! 2. Detects protocol: HTTP/1.1 (REST) or HTTP/2 (gRPC)
//! 3. For HTTP/1.1: parses JSON/SSE responses (Anthropic format)
//! 4. For HTTP/2: decodes gRPC protobuf responses (Google format)
//! 5. Captures token usage data (input, output, thinking, cache)
//! 6. Forwards everything transparently to real upstream servers
pub mod ca;
pub mod h2_handler;
pub mod intercept;
pub mod proto;
pub mod proxy;
pub mod store;