Contents
mitmproxy is a proxy that sits between your browser or app and a web server and shows each HTTP exchange one by one. Once a client trusts mitmproxy’s certificate, you can read HTTPS traffic too. The safest way to start is to leave your system settings alone and send a single curl request through mitmproxy.
This review is for developers who want to check what their own web or mobile app sends, and for people starting to learn how the web works. After reading it, you can do the following:
- Run mitmproxy so that it listens only inside your own computer, and watch traffic in its web interface
- Read a single HTTPS request without changing the certificate store of your OS or browser
- Understand what happens if the certificate’s private key leaks, and clean up when you are done
What mitmproxy does
mitmproxy ships three tools with different interfaces.
| Tool | Interface |
|---|---|
mitmproxy |
An interactive interface inside the terminal |
mitmweb |
An interface you open in a browser |
mitmdump |
No interactive interface. Prints results to the terminal (the official description is “tcpdump for HTTP”) |
- Records and inspects traffic: Open each request and response and read its headers and body. It supports HTTP/1, HTTP/2, and WebSockets.
- Modifies and replays: Edit a recorded request and send it again. It can also replay a saved conversation as a whole.
- Replaces and blocks:
map_localanswers requests for a URL with a local file, andblock_liststops requests to specific sites. - Automates with Python: Load a Python script called an addon with
-sto run code on every request. - Switches how it captures: For apps that ignore proxy settings, local mode captures traffic from apps on the same computer, and WireGuard mode connects other devices such as phones.
Network traffic
- According to the official installation guide, mitmproxy does not “phone home” and does not check for updates.
- Requests you send through it reach their real destination servers. Modified and replayed requests also reach those servers. That is why this review rates its impact as “medium.”
- The listen address is empty by default, so mitmproxy listens on every network interface of your computer. It blocks connections from public IP addresses by default (
block_global), but devices on the same LAN can connect. - The web interface (mitmweb) opens on
127.0.0.1:8081by default and is protected by a random token generated at each startup.
Try it safely with a single curl request
If you install the certificate in your OS or browser, mitmproxy can read every HTTPS connection from that computer. Skip that at first and pass the certificate straight to curl instead. Step 4 assumes a macOS or Linux terminal.
-
Download the installer or binaries for your OS from the official site. On macOS you can also use Homebrew:
brew install --cask mitmproxy. -
Start it in a terminal as shown below. This limits the listener to your own computer, so devices on the same LAN cannot connect.
mitmweb --set listen_host=127.0.0.1A browser opens with the mitmweb interface. On first start, mitmproxy creates its certificate and key in the
.mitmproxyfolder in your home directory. -
In another terminal, send one unencrypted HTTP request through mitmproxy.
curl --proxy 127.0.0.1:8080 http://example.com/A new row appears in mitmweb. Select it to read the request and the response.
-
Now try HTTPS. Pass mitmproxy’s certificate to this one
curlcommand only.curl --proxy 127.0.0.1:8080 --cacert ~/.mitmproxy/mitmproxy-ca-cert.pem https://example.com/The HTTPS request also appears in the list, decrypted. Your OS certificate store has not changed.
-
When you are done, press
Ctrl+Cin the terminal running mitmweb to stop it.
To watch all of a browser’s traffic, set the browser’s proxy to 127.0.0.1:8080 and open http://mitm.it. mitmproxy serves a page there that installs its certificate. Use a separate browser or profile from the one you use every day, and install the certificate only there to limit the impact.
Common uses
| Goal | How |
|---|---|
| Watch browser traffic in a UI | Start mitmweb and set the browser’s proxy to 127.0.0.1:8080 |
| Save traffic to a file and read it later | mitmdump --set save_stream_file=flows.mitm |
| Watch an app that ignores proxy settings | mitmproxy --mode local:<program name> |
| Watch a phone app | Use WireGuard mode and connect the phone over WireGuard |
| Answer requests with a local file | The map_local option |
| Run code on every request | Load a Python addon with -s |
Local mode works on Windows, macOS, and Linux. According to the official docs, on Linux it starts a privileged process with sudo and targets Linux 6.8 and later. It does not work under WSL.
An addon can be a single function. The official example adds one header to every request:
def request(flow):
flow.request.headers["myheader"] = "value"
Save it as add_header.py and load it with mitmdump -s add_header.py.
How it differs from ZAP and Wireshark
| mitmproxy | ZAP | Wireshark | |
|---|---|---|---|
| What you look at | HTTP requests and responses | HTTP requests and responses | Network packets |
| HTTPS content | Readable once the client trusts its certificate | Readable once the client trusts its certificate | Readable with a key log file or similar |
| Automated vulnerability scanning | No | Yes | No |
| Main interface | Terminal and web UI | Desktop app | Desktop app |
| Automation | Python addons | Docker scan scripts and more | Command-line version (TShark) |
If you only want to check what your own app sends, mitmproxy is the better fit. To look below HTTP, for example at DNS or TCP, use Wireshark.
Cautions
- Use it only on traffic from your own devices. Don’t intercept other people’s traffic without their consent.
mitmproxy-ca.pemin the.mitmproxyfolder holds both the certificate and the private key. Anyone with this key can read HTTPS traffic from devices that trust your mitmproxy certificate. Don’t share it, and don’t keep it in a cloud-synced folder.- If you installed the certificate in your OS or browser, remove it when you are done. Leaving it in place means a leaked key could still expose your traffic.
- If you don’t limit the listener to
127.0.0.1, devices on the same LAN can use your proxy. Take extra care on shared Wi-Fi, such as in a cafe. - Apps that pin certificates reject mitmproxy’s certificate, and their connections fail. The official docs suggest letting hosts whose content you don’t need pass through untouched with
ignore_hosts. - The official binaries bundle Python and OpenSSL frozen at release time. The official docs recommend updating to new releases regularly.
Read next
Sources
- Official repository (mitmproxy/mitmproxy)github.com/mitmproxy/mitmproxy
- License (MIT)github.com/mitmproxy/mitmproxy/blob/main/LICENSE
- Installationdocs.mitmproxy.org/stable/overview/installation/
- Getting Starteddocs.mitmproxy.org/stable/overview/getting-started/
- About Certificatesdocs.mitmproxy.org/stable/concepts/certificates/
- Proxy Modesdocs.mitmproxy.org/stable/concepts/modes/
- Optionsdocs.mitmproxy.org/stable/concepts/options/
- Featuresdocs.mitmproxy.org/stable/overview/features/
- Addons: Overviewdocs.mitmproxy.org/stable/addons/overview/
- ZAP: Server Certificateswww.zaproxy.org/docs/desktop/addons/network/options/servercertificates/
- Wireshark Wiki: TLSwiki.wireshark.org/TLS
- Wireshark User's Guide: TSharkwww.wireshark.org/docs/wsug_html_chunked/AppToolstshark.html
Checked on 2026-10-27
Similar tools
MobSF
Impact Local onlyA mobile app security tool that analyzes Android and iOS apps and lists risky permissions, settings, and code issues. You use it from a web browser.
- Purpose
- Audit
- Type
- Web service
- Difficulty
- Intermediate
- License
- CopyleftGPL-3.0
- Category
- Reverse engineering / Vulnerability scanning
Wireshark
Impact Reaches othersA packet analyzer that records network traffic and breaks each packet down by protocol so you can read it.
- Purpose
- Learning
- Type
- Desktop app
- Difficulty
- Beginner
- License
- CopyleftGPL-2.0
- Category
- Network / Forensics
ZAP
Impact Can harm othersA free web app scanner that sits between your browser and a web app, records the traffic, and looks for vulnerabilities. Formerly OWASP ZAP, now ZAP by Checkmarx.
- Purpose
- Audit
- Type
- Desktop app
- Difficulty
- Intermediate
- License
- PermissiveApache-2.0
- Category
- Web security / Vulnerability scanning