1

I'am trying to integrate C# Web Browser control and Fiddler Core. I wan't to do this by letting Fiddler Core to listen to the Web Browser control without affecting any internet explorer or other internet browsers.

The diagram below should show what I want to achieve:

Internet Explorer -> Internet
Chrome -> Internet
Other Browsers -> Internet
Web Browser Control (Custom C# App) -> Fiddler Core -> Internet

The four instance below should run parallel without fiddler core interfering with other browsers. So if I wan't to change the response HTML in my Custom App, this will not affect the other browsers.

I've been searching on Google for a while now but I cannot see any concrete example to get me started.

Thank you in advance guys, any help would be greatly appreciated.

arvstracthoughts
  • 660
  • 1
  • 7
  • 21

1 Answers1

3

FiddlerCore exposes the calling process information in each session's X-ProcessInfo flag.

By default, FiddlerCore will register as the system proxy and most applications will automatically route their traffic through it.

If you want to capture traffic from only a single application, the steps are:

  1. Don't register as the system proxy when calling .Startup.
  2. The target application's proxy settings must be pointed at FiddlerCore's port.

Now #1 is trivial, but #2 is harder, and depends entirely on what networking code the target application uses. You mentioned that the target application is a custom C# application hosting the .NET Web Browser control (which is just IE). If that's the case, and if the application is also hosting FiddlerCore, then you need only call

Fiddler.URLMonInterop.SetProxyInProcess("127.0.0.1:8889", String.Empty);

...inside of your application.

EricLaw
  • 54,427
  • 7
  • 140
  • 182
  • Hi @EricLaw thank you for the response, do you know any code snippet that I can use to get started on this? Thanks you! – arvstracthoughts Feb 06 '15 at 01:37
  • 1
    @arvstracthoughts: I don't understand your question -- my answer includes exactly the code snippet you'd use to send traffic to a FiddlerCore instance, and FiddlerCore itself comes with a demo program showing how to use FiddlerCore in general. (Note: on StackOverflow, new questions should be opened as new questions, not comments). – EricLaw Feb 09 '15 at 19:31
  • Hi @EricLaw, sorry for the misunderstanding, I already got it working, I also found some of your answeres [here](https://groups.google.com/forum/#!msg/httpfiddler/NOxnktF8R0s/Iu1SJbf-d1wJ), [here](https://groups.google.com/forum/#!topic/httpfiddler/kkirFaUbeHw) and [here](https://groups.google.com/forum/#!topic/httpfiddler/10GtCA3HmHI). – arvstracthoughts Feb 10 '15 at 01:08