Description • Installation • Setting • Functioning
It's a simple proxy for controlling and redirecting url patterns defined via regexes in the rule.yml
file, and can also block urls. For each URL blocked or redirected, logs are created in a data
folder.
For this script to work, you must have Python in version 3.9 (or a higher version) and have installed the libraries with: pip install -r requirements.txt
Once the mitmproxy
library has been installed, a folder is created in your user folder (for Windows): C:/Users/%username%/.mitmproxy
. Install the mitmproxy-ca-cert.cer
certificate in the Trusted Root Certification Authorities
folder.
I don't know, but if anyone knows how to do it, I'd like to know how to complete this README.
Activate logs (LOG=True
) by modifying the LOG
variable in the proxy.py
file.
To modify the redirection and blocking rules, modify the rule.yml
file. To block a URL, add the address to the blacklist
category, and to add URLs to redirect, add the addresses to the redirect
category.
blacklist:
- .{0,}discord\.com.{0,}
redirect:
http://127.0.0.1:5432:
- .{0,}youtube\.com.{0,}
In this example, URLs with the domain discord.com
will be blocked, and URLs with the domain youtube.com
will be redirected to http://127.0.0.1:5432
.
In this proxy there is a page published on port 5432
(you can change the port in the logger.py
file) which indicates that this address is blocked by the proxy.