This week's tip of the week is mitmproxy, an open source tool for intercepting, inspecting, and replaying network requests. Think Charles Proxy or Fiddler, but open source with your choice of interface.
The name is not an accident. It sits in the middle of your traffic, hence man in the middle (mitm), so you can see exactly what is going on.
Ever had an API call fail and you're sitting there smashing F5 trying to reproduce it? Or need to test how your app handles a specific error response but you'd have to hit the real endpoint 50 times to trigger it? mitmproxy solves that.
Start it up, configure your browser to use localhost:8080 as a proxy, and all traffic flows through mitmproxy's interface. Click any request to inspect headers, modify payloads, or hit r to replay it.
The web interface at localhost:8081 gives you a browser-based view if you prefer that.

mitmproxy web interface
I used this while building a remote MCP server to see exactly what requests were being made. In that case I used reverse proxy mode, pointing it at my local app instead. Way cleaner than adding console.log statements everywhere. Still love you, console.log!
Three interfaces depending on how you like to work: mitmproxy (terminal), mitmweb (browser), and mitmdump (command line). Works on Linux, macOS, and Windows. Give mitmproxy a go and lemme know what you think!
That's it! Short and sweet. Until the next one!

