Intended to enable redirecting https traffic on for testing API development on existing apps without modifying client code.
Install mitmproxy
brew install mitmproxy
Prepare your Mac to act as a transparent proxy, re-routing http and https traffic through mitmproxy
sudo pfctl -f filter_proxy/pf.conf
Enable pf re-routing and start mitmproxy
sudo pfctl -e
mitmproxy -T --host -s 'filter_proxy/redirect.py api.example.com /apiPrefix localhost 3000'
Disable http/https re-routing
sudo pfctl -d