- [Addon for mitmproxy](https://git.dc09.ru/mitm-archive/addon) intercepting and saving (archiving) all HTTP responses, written in Python
- [Server](https://git.dc09.ru/mitm-archive/server) giving exactly the same responses as in an archive for corresponding method+domain+port+path+query, written in Go
First, check if there is a package provided by your Linux distro and its version is 10.x (NOT 9.x or less).
If there isn't, or you are using Windows, you can download official pre-built binaries: <https://mitmproxy.org/>.
In case you are on a Linux distro without glibc or you don't trust official binaries (that's wise), use `pipx install mitmproxy`.
Mitmproxy also contains native code, so the following packages are required: `base-devel` (includes `gcc`), `openssl-devel`, `libbsd-devel`, `python3-devel`.
Note: these are package names in Void Linux repository; they may not match with yours.
Native library inside `pylsqpack` depends on BSD's `sys/queue.h` which is provided by `libbsd-devel`, but located in `bsd/sys/queue.h`.
Start `mitmproxy` or `mitmweb`. 1st is a CLI, 2nd provides web UI.
I'll assume that you are using Firefox (or forks).
FF supports importing certificates browser-wide and it's simplier to configure HTTP proxy than in Chromium.
I recommend to create a separate browser profile, because next we'll import a TLS cert, and you must remember to remove it after creating an archive for security reasons.
On Firefox, it's `about:profiles` in address bar > Create a New Profile.
**It's just an advice;** if manually switching proxy off and removing mitmproxy cert is OK (you're sure you won't forget), then use your main profile,
but close any active tabs that may produce extra requests that you don't want to be archived (e.g. messenger web clients like Element or Telegram Web).
Now, point your browser to the proxy on `127.0.0.1:8080`.
- Invent a custom format or find an existing one (kind of HashMap) for storing query args and cookies that will make the operations listed above more handy