How to set the Fiddler proxy for macOS terminal
|Product Version||1.0.0 and above|
|3rd-party tools||macOS Terminal, iTerm2|
Terminal applications on macOS like the Terminal or iTerm2 are capable of executing HTTP and HTTPS requests. However, in the common case, they won't use the system proxy, and for Fiddler Everywhere to capture traffic that passes through them, they need to set the Fiddler Everywhere proxy explicitly. To achieve that, we could use the export command.
export http_proxy=127.0.0.1:8866 export https_proxy=127.0.0.1:8866
Once the Fiddler Everywhere proxy is set, we could immediately capture traffic through the terminal application.
Example for making a request while using curl via iTerm2 and intercepting the traffic in Fiddler Everywhere
The export command makes a variable that will be included in a child process environment. It does not affect other already existing environments.
Once our debugging with Fiddler Everywhere is done, we could reset the current environment's proxy by merely removing the Fiddler Everywhere proxy variables. To achieve that, we could use the unset command.
unset http_proxy unset https_proxy
If your terminal application is not supporting unset, then you could reset the proxy by assigning an empty string. For example via