Mitmproxy
lastmod 2025-05-14created 2021-07-1713 edits
Open-source HTTPS Proxy for intercepting, modifying, and replaying web traffic such as HTTP 1/2, WebSocket, and SSL/TLS
Features
- Provides CLI + Web UI + Python API, with a powerful ecosystem
- New features in 7.0
- Full TCP support (protocols like SMTP)
- HTTP/1 and HTTP/2 interoperability: connect HTTP/2 clients to HTTP/1 servers
- Support for displaying WebSocket messages in the UI
- Secure Web Proxy (TLS-over-TLS)
- Console UI support on Windows as well
- Web UI improvements: rendering of TCP / WebSocket flows, support for cURL/HTTPie/Raw HTTP Export
- Async Event Hook support
- New TLS Event Hook support (TLS Handshake success/failure)
- SOCKS v5 authentication support
Usage
To change the port:
Docker Usage
To launch the terminal user interface of mitmproxy:
| NOTE |
| The volume mount |
Once started, mitmproxy listens as an HTTP proxy on localhost:8080:
$ http_proxy=http://localhost:8080/ curl http://example.com/
$ https_proxy=http://localhost:8080/ curl -k https://example.com/ # `-k` 옵션 주목
| INFORMATION |
| Note that lowercase is used when using it with curl. |
You can also start mitmdump by just adding that to the end of the command-line:
For mitmweb, you also need to expose port 8081:
$ docker run --rm -it -p 8080:8080 -p 127.0.0.1:8081:8081 mitmproxy/mitmproxy mitmweb --web-host 0.0.0.0
You can also pass options directly via the CLI:
If ~/.mitmproxy/mitmproxy-ca.pem is present in the container, mitmproxy will assume uid and gid from the file owner. For further details, please consult the mitmproxy documentation.
Caveats when using Docker
Going through the Proxy, the request ends up being re-sent from Docker to the target server, so if you use something like localhost as the URL, the Guest OS makes a localhost loopback request. Therefore you must type the Host PC's IP directly.
Connecting via reverse tunneling
See OpenSSH#Connecting via reverse tunneling.
See also
- Proxy
- Proxy Server
- httpie
- tcpdump
- MitmProxy2Swagger - Automatic REST API reverse engineering tool
- Ophiuchi - Local HTTPS proxy server manager using Docker
Favorite site
- Mitmproxy 7 release !
- Inspecting network traffic of iOS devices with mitmproxy :: Outsider's Dev Story