FiddlerCore - Multithreading webbrowser, getting same session

363 views Asked by At

I am with a very specific question, and I'll try to explain the best I can. I'm using windows forms, with webbrowser, multithread and fiddler.

My application executes different forms in multiple threads. There is an webbrowser on each form, that is running at the same time as the other webbrowsers on the other forms. Each of them uses fiddlercore, and some of them navigate to the same website, searching for some information.

In the fiddlercore code, I use the event FiddlerApplication_AfterSessionComplete to capture all the traffic from the website (on each of the webbrowsers).

The main problem is that fiddler doesn't distinguish from which thread I'm navigating, so sometimes it takes the information that's supposed to be on another thread to the form that's navigating to the same page, but searching another things.

So, what I really need is a way to check if the Session I got from fiddler is the same as launched from that specific form.

If you need, I can post some code, but I don't think it's actually necessary.

I appreciate any help.

1

There are 1 answers

1
2GDev On BEST ANSWER

I don't know fiddlercore but from documentation on FiddlerApplication_AfterSessionComplete should be a Fiddler.Session object with an oRequest property of type ClientChatter. ClientChatter has a headers property,

So my suggestion is to add a Custom Header with a unique identifier (thread number.. guid..) in the request and check for this header when FiddlerApplication_AfterSessionComplete is fired to match Request / Response.