How to quickly create a header modifying reverse proxy with mitmproxy

I’m currently in the process of testing some changes on OctoPrint involving its automatic user login via request headers, and for that needed to quickly set up a reverse proxy that would modify the headers of the requests going to the development server for some quick testing. Specifically, I wanted a quick CLI tool that would allow me to set up a reverse proxy listening on port 5555, forwarding to http://localhost:5000 while also setting the headers X-Remote-User to remote and X-Remote-Host to localhost:5555....

March 12, 2024 · 1 min
Mastodon