Fiddler Core not capturing anything

398 views Asked by At

I wanted to test FiddlerCore.

Found this -> http://www.c-sharpcorner.com/UploadFile/d9e6f2/capturing-http-traffic-in-C-Sharp/

I wrote it but for me it not capturing.

My code:

delegate void UpdateUI();
public Form1()
{
   InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
   Fiddler.FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete;
   Fiddler.FiddlerApplication.Startup(0, FiddlerCoreStartupFlags.Default);
}
void FiddlerApplication_AfterSessionComplete(Fiddler.Session oSession)
{
   listBox1.Invoke(new UpdateUI(() =>
   {
      listBox1.Items.Add(oSession.url);
   }));
}
private void Form1_Closing(object sender, FormClosingEventArgs e)
{
   Fiddler.FiddlerApplication.Shutdown();
}
1

There are 1 answers

1
vmg On

It works for me. Have you wired Form Load and Form Closing events to the form? Can you please provide source of InitializeComponent() method. I suspect that you are missing this:

this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
        this.Load += new System.EventHandler(this.Form1_Load);

Btw, what OS are you using?