fiddler-core-docs/basic-usage/capture-https-traffic.md

2.3 KiB

title description slug tags published position
Capture HTTP/S Traffic Use FiddlerCore application events to capture and analyze HTTP and HTTPS traffic capture-https-traffic capture-https-traffic True 30

Capture HTTP/S Traffic with FiddlerCore

This article explains how to capture HTTP/S traffic with FiddlerCore

Once FiddlerCore is [configured]({%slug configuration %}), it starts to listen for a traffic on the background. When it captures any session, it notifies you by raising the following events:

tip The following event handlers are invoked on session-handling background threads.

If you need to update a UI thread (e.g. in WPF or Windows Forms application), you may need to delegate the update logic back to the UI thread, for example by using Dispatcher.BeginInvoke (WPF) or Control.Invoke (Windows Forms).

Also, if you use collections that are not thread-safe, like List<T>, you may need to employ additional synchronization mechanisms.

FiddlerApplication.BeforeRequest

You should use this event to act when client request is received. For example, you can modify the session flags to use specific ssl protocols.

    FiddlerApplication.BeforeRequest += session => 
    {
        session["x-OverrideSslProtocols"] = "ssl3;tls1.0;tls1.1;tls1.2";
    };

FiddlerApplication.BeforeResponse

You should use this event to act when a server response is received. For example, you can decode the body.

    FiddlerApplication.BeforeResponse += session => 
    {
        session.utilDecodeResponse(); 
    };

FiddlerApplication.AfterSessionComplete

You should use this event to act when a session is completed. For example, notify the user.

    FiddlerApplication.AfterSessionComplete += session => 
    {
        Console.WriteLine($"Finished session: {session.fullUrl}");
    }

tip These are only the most commonly used handlers. For the full list of events check FiddlerApplication's API reference.

Next Steps

  • [Import/export sessions]({%slug import-export-sessions%})