Skip to main content

Module mitm_local

Module mitm_local 

Source
Expand description

Local MITM capture, CA, and HAR export (one-shot). One-shot local MITM capture helpers (PRD §5E).

This module:

  • Generates/loads a local CA under XDG data (mitm/ca)
  • Stores invocation captures under XDG state (mitm/)
  • Exports HAR JSON without Python mitmproxy

Full TLS intercept proxy (hudsucker) can attach to the same capture store. CDP Network remains complementary and can feed the same HAR exporter.

Structs§

CapturedExchange
One captured HTTP(S) exchange (agent-facing, secrets redacted by default).
CapturedWsFrame
One captured WebSocket frame (agent-facing, truncated).
MitmCapture
In-memory + disk-backed capture for one process.

Functions§

allow_host
Persist allowlist host under XDG state.
apis
Discover REST/GraphQL-ish endpoints from capture.
block_rule
Persist block rule note under XDG state (applied on next capture when hosts filter used).
capture_url_oneshot
One-shot: bind MITM on 127.0.0.1, launch Chrome with proxy, navigate url, capture, DIE (GAP-011).
default_capture_path
Default capture file for this user (latest).
domains
List unique hosts.
ensure_ca
Ensure CA key/cert exist under XDG; return paths.
export_har
Export HAR 1.2 JSON (hand-built; no Python).
get
Get one exchange by id.
graphql
List GraphQL-ish exchanges from the current capture (GAP-019).
import_cdp_network
Import CDP-style network events (array of {method,url,status,…}) into capture.
list
List captured requests.
redact_policy
Redact policy status (always redacts Authorization/Cookie by default in capture store).
shared_capture
Create shared capture bound to default path.
start_proxy_oneshot
One-shot MITM proxy on 127.0.0.1:0 using hudsucker + local CA.
status
Status of MITM readiness + capture counts.
ws_get
Get one WebSocket frame by index id (GAP-019).
ws_list
List WebSocket frames from capture (GAP-019).

Type Aliases§

BTreeMapString
Stable map type alias for headers.
SharedCapture
Shared capture for optional in-process proxy (thread-safe).