Mitmproxy is an interactive console program that allows traffic flows to be intercepted, inspected, modified, and replayed. After researching for this section, I decided that the easiest and most complete way to learn about HTTP proxies in Python is by using mitmproxy. Any other attempt is more complex and limited than mitmproxy.
Mitmproxy is developed in Python and allows users to extend it via their inline scripts. It supports SSL out of the box, unlike other alternatives out there that support only HTTP.
Let's see how mitmproxy works using a simple example. If we go to the Terminal and type mitmproxy, we get an mitmproxy console listening at port 8080:
If we change our browser settings to use proxy for HTTP connections, ...