An adblocker that runs as a proxy server! (And works on HTTPS connections.)
Use this to block ads on your mobile device, or just monitor its traffic.
- Install mitmproxy
- Install required python modules:
$ pip install 'Cython>=0.29.19,<1.0' # for pyre2
$ pip install -r requirements.txt
- Run
./update-blockliststo download some blocklists - Run
./goto start the proxy server on port 8118 (or run./go -cfor a curses interface which lets you inspect the requests/responses, or run./go -dto dump all flows to the 'flows/' directory) - Do a quick test to make sure it's working:
curl --proxy localhost:8118 -L -k https://slashdot.org/ - Setup your browser/phone to use
localhost:8118orlan-ip-address:8118as an HTTP proxy server; then, visit http://mitm.it on that device to install the MITM SSL certificate so that your machine won't throw security warnings whenever the proxy server intercepts your secure connections.
If you'd like to change any of the mitmproxy settings (like port, and where/whether it logs your connections), edit the go script.