Skip to main content

Mitmproxy

@magistr/mitmproxyv2026.10.25.10· MIT· 1d agoBEHAVIORS
01README

Install, run and inspect a local mitmproxy (HTTP/HTTPS intercepting proxy) from swamp.

Model @magistr/mitmproxy:

  • install — uv tool install --no-build mitmproxy (wheels only)
  • status — version, process, listener and CA certificate state
  • start — run mitmdump or mitmweb in the background (idempotent)
  • stop — stop the background proxy (idempotent)
  • flows — summarise captured flows, filtered by a mitmproxy filter expression
  • clear_flows — empty the capture file
  • trust_ca — trust the mitmproxy CA in the macOS login keychain

Flows stream to <stateDir>/flows.mitm and are read back through mitmdump's built-in HAR export, so no Python addon is required.

02Release Notes

2026.10.25.10

  • Repo-wide republish; no functional change.
03Behaviors1
@magistr/mitmproxyv2026.10.25.10extensions/models/mitmproxy.ts

Global Arguments

ArgumentTypeDescription
binDir?stringDirectory holding mitmdump/mitmweb. Default: ~/.local/bin if present,
confdir?stringmitmproxy confdir (CA certificates). Default: ~/.mitmproxy
stateDir?stringWhere the pid file, log and flow capture live. Default:
listenHost?stringProxy listen address
listenPort?numberProxy listen port
mode?stringmitmproxy --mode: regular, socks5, upstream:URL, reverse:URL,
ui?enumdump runs headless mitmdump; web runs mitmweb with its browser UI
webHost?stringmitmweb UI address
webPort?numbermitmweb UI port
options?preprocessExtra mitmproxy options passed as --set key=value
fn install(python?: string, version?: string, upgrade?: boolean)
Install mitmproxy with `uv tool install --no-build`
ArgumentTypeDescription
python?stringPython version uv uses for the tool venv (must have mitmproxy wheels)
version?stringPin a mitmproxy version; default is the latest
upgrade?booleanReinstall even when mitmproxy is already present
fn status()
Read installed version, process, listener and CA state.
fn start(timeoutSeconds?: number)
Start mitmdump (ui=dump) or mitmweb (ui=web) in the
ArgumentTypeDescription
timeoutSeconds?numberHow long to wait for the proxy port to accept connections
fn stop(timeoutSeconds?: number)
Stop the background proxy started by `start`. No-op when
ArgumentTypeDescription
timeoutSeconds?numberGrace period after SIGTERM before SIGKILL
fn flows(filter?: string, limit?: number, includeHeaders?: boolean)
Summarise captured flows (method, URL, status, size,
ArgumentTypeDescription
filter?stringmitmproxy filter expression, e.g. '~d example.com & ~m POST'
limit?numberKeep only the newest N matching flows
includeHeaders?booleanInclude request/response headers in each flow
fn clear_flows()
Delete the flow capture file. Refuses while the proxy
fn trust_ca()
Trust the mitmproxy CA certificate in the macOS login

Resources

installation(infinite)— Installed mitmproxy version
status(infinite)— Proxy process, listener and CA certificate state
flows(infinite)— Summary of captured flows
04Previous Versions1
2026.10.21.2MIT

2026.10.21.2

Fixed

  • Option keys must start with a letter. __proto__ was accepted, then silently dropped. Keys containing digits, such as http2, are now accepted.
05Stats
A
100 / 100
Downloads
5
Archive size
13.9 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
06Platforms
07Labels