The terminal capturing mode in Fiddler Everywhere allows you to set the Fiddler's proxy on a dedicated terminal instance. The terminal capturing mode lets you use the proxy in a sandboxed environment without changing the global OS proxy settings. Simultaneously, using a sandboxed proxy provides better control of the captured traffic.
To capture terminal traffic with Fiddler Everywhere:
Start Fiddler Everywhere.
Open the Home pane.
Open the Terminal tutorial, and then click on Open Terminal.
Start Fiddler Everywhere.
Open the Traffic pane.
Click on the >_ Terminal button to load terminal instance.
Start your application within the terminal instance.
As a result, Fiddler Everywhere opens a dedicated terminal instance and starts capturing the ongoing HTTPS traffic immediately. It's important to note that Fiddler will capture the traffic generated from the terminal and any child process that originates (starts) from the same terminal instance. The terminal instance will lose connectivity if Fiddler Everywhere application is closed.
You can set your preferred terminal application through Settings > Terminal > Default Terminal. The following options are available:
- Command Prompt—Available only on Windows.
- Windows PowerShell—Available only on Windows. Specifies the Windows PowerShell built on .NET Framework 4.5 and older versions.
- PowerShell—Available only on Windows. Specifies the PowerShell built on .NET Core or the new .NET.
- Terminal application—Available on macOS and Linux. This option will use the default shell environment, for example, bash, zsh, or sh.
The Fiddler's terminal instance automatically proxies all HTTPS requests made by curl, Python or Node.js libraries (like https, request, etc.) and all applications which respect the
https_proxy environment variables.
While using the terminal capturing mode, you must consider the technical specifics listed below.
Some frameworks, like the .NET Framework, are hardcoded not to send requests for localhost through any proxies, and as a proxy, Fiddler will not receive such traffic.
Because Windows PowerShell uses the .NET Framework (not to be confused with PowerShell, which uses .NET Core), the localhost traffic won't be sent through the proxy. You can workaround the issue by using the Fiddler's aliases or adding a dot to the end of the localhost address (for example,
Capturing traffic from curl or Node.js libraries does not require explicitly installing and trusting the Fiddler certificate authority on the Fiddler host. However, this is a mandatory requirement for a NET application that executes HTTPS requests.
The terminal capturing mode is the recommended approach because it sets the proxy only per the current session, which makes it considerably more comfortable for testing and debugging. Use the below method only if you aim to solve specific application requirements (for example, an application that does not respect the terminal proxy implicitly).
As an alternative to the Fiddler's terminal option described above, you can also explicitly configure your terminal and shell applications to respect the Fiddler proxy and trust the Fiddler root CA. One way to achieve that is to use the
export command (for macOS and Linux) or the
set command (for Windows) alongside the
https_proxy variables. The
export command will generate an environmental variable that will be included in a child process environment. It does not affect other already-existing settings.
The following example demonstrates how to define the proxy settings through environmental variables on macOS and Linux.
The following example demonstrates how to define the proxy settings through environmental variables on Windows.
Once the Fiddler Everywhere proxy sets, you can immediately capture traffic through the terminal application.
The following example demonstrates how to request while using cURL through iTerm2 and intercept the traffic in Fiddler Everywhere.
curl https://docs.telerik.com/fiddler-everywhere --
Apart from setting the environment variables
https_proxy, you can manually export and point your terminal application to explicitly use the Fiddler_Root_Certificate_Authority (for decrypting TLS traffic). You must use different global variables depending on the specific application/framework. For example, you can use variables like
REQUESTS_CA_BUNDLE for configuring the Fiddler's CA within a Python application.
Once debugging with Fiddler Everywhere, reset the current environment proxy by removing the Fiddler Everywhere proxy variables. You can use the
unset command on macOS and Linux to achieve that. On Windows, you need to set an empty string.
The following example demonstrates how to unset the proxy on macOS and Linux.
The following example demonstrates how to unset the proxy on Windows.