FiddlerCore Api

FiddlerCore API

Programming against the FiddlerCore API is pretty simple. First, attach event handlers to the Fiddler.FiddlerApplication object to receive notification of HTTP(S) requests and responses, and any UI notifications you may want to pass along to the user or log file. Then, call Startup() to tell FiddlerCore to begin listening for requests. When you're done with FiddlerCore, call Shutdown().

// Call Startup to tell FiddlerCore to begin listening on the specified port,
// and optionally register as the system proxy and optionally decrypt HTTPS traffic.
Fiddler.FiddlerApplication.Startup(8877, true, true);
// Call Shutdown to tell FiddlerCore to stop listening on the specified port, and 
// unregister as the system proxy if attached.

See the FiddlerCore demo source

Fiddler API

Beyond the FiddlerCore-specific APIs, the majority of the code is shared with Fiddler, so code written to work as a Fiddler extension will work nicely inside an application using FiddlerCore.

See the Fiddler Developer Documentation

You might also want to check out the Class Explorer inside the FiddlerScript Editor.

A word on exceptions…

Calling Shutdown() while a background thread is still handling a request can cause a NullReferenceException or an ObjectDisposedException in that thread. You can ensure that any exceptions in the network-handling thread don’t bring down your application by creating a manifest for your executable (named appname.exe.config, in the same folder as appname.exe) which specifies “legacyUnhandledExceptionPolicy enabled=1”. See MSDN for more details on this.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License