Note: instructions work with macOS.
python3 proxy.py 127.0.0.1
curl -x 127.0.0.1:8000 -H "Host: example.com" -X GET http://www.example.com
curl -x 127.0.0.1:8000 -d "message=hello world" -H "Host: httpbin.org" -X POST http://httpbin.org/post
curl -x 127.0.0.1:8000 -d "message=hello world" -H "Host: httpbin.org" -X CONNECT http://www.example.com/ --output output.o cat output.o
Firefox should be able to use this proxy server for http.