前言
It’s a powerful man-in-the-middle proxy that allows you to intercept, modify, replay, and save HTTP/S traffic.
Introduction
mitmproxy
is an interactive man-in-the-middle proxy for HTTP and HTTPS with a console interface.
Documentation, tutorials and distribution packages can be found on the mitmproxy website:mitmproxy.org
It is very useful for networking debugging and testing because you can intercept HTTP & HTTPS requests and responses and modify them on the fly. I will list the steps to use this tool.
Tutorials
This tutorials only for mac user, other platform user please goto mitmproxy.org.
- Install
mitmproxy
on a Mac
use this command to installmitmproxy
brew install mitmproxy
Run this command and waiting it finish. - Set proxy on a Mac
aftermitmproxy
is installed, you can just runmitmproxy
to start the proxy server. If you want to use this proxy server on a iOS simulator or your Mac, you need update your proxy on your Mac. The proxy server is your Mac IP address.
Next open this mitm.it website to install a certificate, then you can see all network traffic on a mitmproxy console. - Set proxy on an iPhone
First go to iPhone WIFI setting, and then set your proxy server.(The proxy server is your mac IP address which run themitmproxy
, current my Mac IP address is :10.8.144.254)
After the proxy server is set, open this mitm.it website with Safari. Install a profile by clicking the Apple icon when you can see the screen below.
After you have done the steps above, If you are on iOS 10.3 or later, open the Settings.app and navigate to General > About > Certificate Trust Settings, and find the mitmproxy certificate, and switch it on to enable full trust for it (More information about this change in iOS 10).
When all steps have done, you can see all iPhone network traffic onmitmproxy
console.