Fiddler Setup & Configuration: Mocking And Manipulating API Behavior With A Local Proxy Server – Part 4

In this five-part article series, you will learn how to manipulate your API behavior with a local proxy server. After an introduction, learning how to set up and configure Charles Proxy, and seeing it in action, we are now taking a look at the Fiddler setup and configuration.

In diesem Artikel:

For Windows, you have to download the setup file and follow the instructions.

For macOS and Linux, you need to have the Mono framework installed on your machine. Make sure to install Mono version 5.18 as Fiddler cannot decrypt SSL connections on newer versions. Telerik is currently re-implementing Fiddler’s features in a new project called Fiddler Everywhere, which is not yet rich enough of features as we would need it.

To execute Fiddler on macOS, you have to follow two steps:

  1. Accept the xcodebuild license by executing on the terminal: sudo xcodebuild -license
  2. Start Fiddler with the 32-bit command: mono --arch=32 Fiddler.exe

The first run can take a couple of minutes. Once Fiddler starts, you will be prompted for your password so that Fiddler automatically sets up your system proxy.

On Linux, you have to set up your system proxy settings manually. You can either

  • set your $http_proxyand $https_proxyenvironment variables to localhost:8888 or
  • install a browser add-on for easy toggling between proxy on/of just for browser traffic.

SSL Decryption

For HTTPS traffic inspection, you need to set up SSL decryption in an extra step. When enabled, Fiddler opens encrypted channels on its own and acts as a middleman. Fiddler’s certificate has to be trusted to avoid security errors.

On Windows, click „Tools“ → „Options“ → „HTTPS“. Check „Decrypt HTTPS traffic“ and then select „Actions“ → „Trust Root Certificate“.

On Linux, this option creates an error. Instead, you have to trust the certificate manually. To do so, select the action „Export Root Certificate to Desktop“. Then execute the following commands:

				
					$~ sudo mv Desktop/FiddlerRoot.cer /etc/ca-certificates/trust-source/anchors/FiddlerRoot.cert
$~ sudo trust extract-compat
				
			

Then restart Fiddler and your browser.

On macOS, please follow this guide.

Recording Your Traffic

Fiddler has the recording feature turned on by default, so you will probably see much recorded traffic already.

To get rid of the noise, you can activate a filter to focus completely on your project’s traffic. On the right side, select the tab „Filters“. Then check „Use Filters“, select „Show only the following Hosts“ and enter your API’s domain.

Deactivate Caching

Like in Charles Proxy, you need to disable caching to get any response bodies. In the menu bar, click „Rules“ → „Performance“ → „Disable Caching“.

The next and final article of this series will show you Fiddler in action.

Mehr Artikel zu Tools, API
Kostenloser
Newsletter

Aktuelle Artikel, Screencasts, Webinare und Interviews unserer Experten für Sie

Verpassen Sie keine Inhalte zu Angular, .NET Core, Blazor, Azure und Kubernetes und melden Sie sich zu unserem kostenlosen monatlichen Dev-Newsletter an.

Newsletter Anmeldung
Diese Artikel könnten Sie interessieren
Tools
sg

Git Fixup: Wie repariere ich meine Historie?

Git gibt uns mit der fixup-Option eine einfache aber effektive Möglichkeit, kleine Versäumnisse nachträglich so zu korrigieren, dass sie gar nicht mehr auffallen. Wie das genau geht, wollen wir in diesem Artikel erforschen. Mein Kollege Yannick Baron hat in seiner englischen Artikelserie zu Git bereits den interactive Rebase behandelt. Dort hat er auch die Möglichkeiten des fixup kurz angesprochen. Hier wollen wir uns etwas intensiver mit diesem Feature befassen.
07.10.2021
API
sg

Verwendung für Postman-Tests: ASP.NET Core API-Dokumentation mit Swagger – Teil 10 [Screencast]

Im zehnten und letzten Teil sehen Sie, wie Sie aus der Dokumentation auch Postman-Tests generieren können.
18.05.2021
API
sg

Code-Generierung aus der Dokumentation: ASP.NET Core API-Dokumentation mit Swagger – Teil 9 [Screencast]

Im neunten Teil sehen Sie, wie aus unserer Dokumentation vollständige Clients generiert werden können.
04.05.2021
API
sg

Swagger-UI anpassen: ASP.NET Core API-Dokumentation mit Swagger – Teil 8 [Screencast]

Im achten Teil sehen Sie, welche Modifikationen Sie am Swagger-UI vornehmen können. Zum Beispiel die Einbindung eines eigenen Logos in die Dokumentation oder einige weitere Features die Swagger mitbringt, welche aber nicht von Beginn an aktiviert sind.
30.03.2021
API
sg

Einbindung von Authentication & Authorization: ASP.NET Core API-Dokumentation mit Swagger – Teil 7 [Screencast]

Im siebten Teil sehen Sie, wie eine API, die Authentifizierung benötigt, korrekt dokumentiert wird.
25.02.2021
API
sg

Dokumentation versionierter APIs: ASP.NET Core API-Dokumentation mit Swagger – Teil 6 [Screencast]

Im sechsten Teil sehen Sie wie Sie vorgehen können, um mehrere API-Versionen gleichzeitig zu dokumentieren und wie Sie diese Versionen in SwaggerUI einbinden.
10.02.2021