Migrating from mitmproxy

A map of mitmproxy's features onto Solpuga's and how to carry a recorded session over as HAR: what travels, what is lost, and the limits.

What maps to what

Most of mitmproxy's features are options (--set) and keyboard shortcuts; Solpuga has them under Tools, in Settings and in the request list's context menu.

mitmproxy Solpuga
map_local Map Local
intercept Breakpoints
modify_headers, modify_body Rewrite
allow_hosts SSL Proxying: selected hosts only
ignore_hosts Bypass list
Filters such as ~d, ~u, ~b Search, bodies included, and filters
Export a request as curl Copy as cURL
hardump, save.har HAR 1.2 export
Reading HAR with -r HAR import, read-only
Certificate from mitm.it Setup wizards: iOS (on macOS) and Android
map_remote Partly: via Rewrite
Upstream mode Partly: system proxy or PAC only, no authentication
Transparent mode Partly: Linux only
WebSocket Partly: messages recorded, none sent
Python addons Partly: Rewrite, no code

Carrying sessions over as HAR

Only mitmproxy reads its own flow format, so the way across is HAR. mitmproxy writes HAR since version 10.1.

In mitmproxy. In the console mitmproxy, type the command :save.har @all session.har. A recording saved earlier converts to HAR with mitmdump:

mitmdump -nr flows --set hardump=session.har

-r reads the recorded flows from a file, -n does not start the proxy, and hardump saves everything it read to a HAR on exit.

In Solpuga. Tools → Import Session from HAR… (Cmd/Ctrl + Shift + I), or open the .har from a file manager. The file opens in a separate read-only window with its own list and inspector: live capture is not touched.

Files over 500 MB are refused: export a long recording in parts.

What travels

Request and response headers, bodies, statuses, timings — everything HAR 1.2 describes. The imported window has the same inspector as the capture view: JSON folds into a tree, images open with zoom, binary shows as hex.

What is lost

  • Options and addons. HAR describes traffic, not settings. map_local, modify_headers, intercept and scripts have to be set up again as rules. The fastest way is to create a rule from a request in live capture: it is pre-filled with the response that actually came back.
  • WebSocket. Standard HAR has no place for the messages.
  • Non-HTTP traffic. Raw TCP and UDP streams and DNS queries that mitmproxy records do not go into HAR.
  • Binary request bodies. HAR 1.2 has no encoding field for a request body, and programs work around that in different ways. If a binary body opens as text, that is why.

What you get instead

An app window instead of a terminal, certificate setup wizards for an iPhone, Android, the iOS Simulator and an Android emulator, an interface in English and Russian, and a free tier with no time limit.

View in Solpuga

Tool for this page

HAR viewerOpen a HAR file and read the requests, headers, bodies and timings.

Related