mitmproxy

A proxy that sits between your browser or app and a web server, so you can record, inspect, and modify HTTP traffic, including HTTPS.

cat mitmproxy/meta.ymlChecked on 2026-10-27

Safety

Impact Reaches othersSees other people's traffic or sends traffic to their devices
Admin rights
Not required
Test lab
Not required

Usage

Purpose
Audit
Difficulty
Intermediate
Type
Command line
Platforms
Windows / macOS / Linux / Docker

Trust

Repository
mitmproxy/mitmproxy
License
PermissiveMIT
GitHub
stars46,7852026-11-10
Maintenance
Actively updatedLast update 2026-11-09
Contents
  1. Introduction
  2. What mitmproxy does
  3. Network traffic
  4. Try it safely with a single curl request
  5. Common uses
  6. How it differs from ZAP and Wireshark
  7. Cautions
  8. Read next
  9. Sources

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_local answers requests for a URL with a local file, and block_list stops requests to specific sites.
  • Automates with Python: Load a Python script called an addon with -s to 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.
What it doesn’t domitmproxy does not include a scanner that searches for vulnerabilities automatically. If you need automated testing, use ZAP.

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:8081 by 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.

  1. Download the installer or binaries for your OS from the official site. On macOS you can also use Homebrew: brew install --cask mitmproxy.

  2. 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.1

    A browser opens with the mitmweb interface. On first start, mitmproxy creates its certificate and key in the .mitmproxy folder in your home directory.

  3. 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.

  4. Now try HTTPS. Pass mitmproxy’s certificate to this one curl command 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.

  5. When you are done, press Ctrl+C in 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.pem in the .mitmproxy folder 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.

Sources

  1. Official repository (mitmproxy/mitmproxy)github.com/mitmproxy/mitmproxy
  2. License (MIT)github.com/mitmproxy/mitmproxy/blob/main/LICENSE
  3. Installationdocs.mitmproxy.org/stable/overview/installation/
  4. Getting Starteddocs.mitmproxy.org/stable/overview/getting-started/
  5. About Certificatesdocs.mitmproxy.org/stable/concepts/certificates/
  6. Proxy Modesdocs.mitmproxy.org/stable/concepts/modes/
  7. Optionsdocs.mitmproxy.org/stable/concepts/options/
  8. Featuresdocs.mitmproxy.org/stable/overview/features/
  9. Addons: Overviewdocs.mitmproxy.org/stable/addons/overview/
  10. ZAP: Server Certificateswww.zaproxy.org/docs/desktop/addons/network/options/servercertificates/
  11. Wireshark Wiki: TLSwiki.wireshark.org/TLS
  12. Wireshark User's Guide: TSharkwww.wireshark.org/docs/wsug_html_chunked/AppToolstshark.html

Checked on 2026-10-27

Similar tools

MobSF

Impact Local only
MobSF/Mobile-Security-Framework-MobSF

A 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
Actively updatedstars22,187Last update 2026-11-10
Read the MobSF review

Wireshark

Impact Reaches others
wireshark/wireshark

A 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
Actively updatedstars10,192Last update 2026-11-10
Read the Wireshark review

ZAP

Impact Can harm others
zaproxy/zaproxy

A 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
Actively updatedstars16,154Last update 2026-11-06
Read the ZAP review