Start MITM proxy
proxy_startStarts a local HTTPS MITM proxy and returns the LAN IP:port to set as your device's Wi-Fi proxy, enabling interception and mocking of network traffic with passthrough for unmatched requests.
Instructions
Bring up the mockttp HTTPS MITM proxy. Returns the LAN IP : port to type into the device's manual Wi-Fi proxy settings. Unmatched requests pass through to the real headend. If the device is an Android emulator, pass hostRewrites to map its 10.0.2.2 alias (means 'host loopback', only valid inside the emulator) to 127.0.0.1 so Metro/dev-server passthrough can reach the Mac.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | TCP port to listen on (default 8889). | |
| scope | No | Capture-scope hostnames: only traffic for these hosts (and their subdomains) is retained in the log, to keep agent context small. Default [] (or omitted) = retain all captured traffic. Entries are hostnames or wildcard '*.example.com'. The proxy still MITMs and serves ALL hosts — scope only controls what is retained in proxy_list_traffic. Adjust at runtime with proxy_scope. | |
| hostRewrites | No | Rewrite the upstream dial target for passthrough traffic. Use this when a device reaches the dev PC via a special alias that is not a real address on the Mac — e.g. the Android emulator's 10.0.2.2:8081 (maps to host loopback only from inside the emulator) -> 127.0.0.1:8081. | |
| passthroughHosts | No | Host:port entries whose traffic should bypass MITM interception entirely (e.g. the React Native Metro bundler). Each entry is 'hostname' or 'hostname:port'. The hostname is matched against CONNECT tunnels; port globs (e.g. ':808*') are recorded for future HTTP-level filtering. Example: ['192.168.0.2:8081', 'localhost:8081']. | |
| restoreTransforms | No | Path to a JSON file previously saved by proxy_save_transforms. Transforms are restored idempotently (by method+url+regex). |