"When hostnames and headers are hard to edit: mitmproy add-ons"
"The mitmproxy tool also supports addons where you can transform HTTP requests between Claude Code and third-party web servers. For example, you could write an add-on that intercepts https://api.anthropic.com and updates the X-API-Key header with an actual Anthropic API Key."
"You can then pass this add-on via mitmproxy -s reroute_hosts.py."
If using HAproxy, then is no need to write "add-ons", just edit the configuration file and reload
"The mitmproxy tool also supports addons where you can transform HTTP requests between Claude Code and third-party web servers. For example, you could write an add-on that intercepts https://api.anthropic.com and updates the X-API-Key header with an actual Anthropic API Key."
"You can then pass this add-on via mitmproxy -s reroute_hosts.py."
If using HAproxy, then is no need to write "add-ons", just edit the configuration file and reload
For example, something like
For me, HAproxy is smaller and faster than mitmproxy