Using FiddlerCore with GeckoFX

428 views
Skip to first unread message

Filipe Scur

unread,
Jan 16, 2014, 1:00:37 PM1/16/14
to
Hi guys,

I am developing a C# application that uses fiddlercore to intercept some requests, and then replay them. 

The logic is pretty simple. I have a embbeded webbrowser (GeckoFX) in my app. Users start navigating the web and when they want to record the session, they push a record button and the next request is captured by fiddlercore. I save the request and replay it later. Problem is that I was not able to capture any request when I set fiddler to be the app proxy. The only way I can capture the request is when it is initialized as system proxy. It would be okey, except that when it is set as system proxy, Chrome starts rejecting HTTPS traffic (DO_NOT_TRUST_FIDDLERROOT certificate is not valid);

Resuming:

    Case 1

    Fiddler.FiddlerApplication.Startup(8888, false, true);
    Fiddler.URLMonInterop.SetProxyInProcess("127.0.0.1:8888", null);

    If I start fiddlercore like this, it does not capture requests made by my embbeded web browser (GeckoFX).

   Case 2

    Fiddler.FiddlerCoreStartupFlags flags = Fiddler.FiddlerCoreStartupFlags.Default & ~Fiddler.FiddlerCoreStartupFlags.RegisterAsSystemProxy;
    Fiddler.FiddlerApplication.Startup(0, flags);

    Does not work either.

    Case 3

    Fiddler.FiddlerCoreStartupFlags flags = Fiddler.FiddlerCoreStartupFlags.Default;
    Fiddler.FiddlerApplication.Startup(0, flags);

    Chrome rejects https traffic (ie.: Google apps stops working, etc.)

    Any thoughts???

EricLaw

unread,
Jan 16, 2014, 1:00:57 PM1/16/14
to
Gecko is not based on URLMon, hence the URLMonInterop call has no effect on it. (That call impacts Internet Explorer-based Web Browser controls, and anything else based on URLMon).

You probably want to instead call a GeckoFX API call to set its proxy directly; see e.g. http://stackoverflow.com/questions/13503226/how-do-i-change-geckofx-proxy-settings for more details on this.

If you do want to set the proxy system-wide, you can easily write code inside your BeforeRequest handler to ignore / not-decrypt traffic coming from processes other than your own; this will resolve the certificate issue you noticed (as would using the TrustRootCertificate() method). However, your best bet is to only set the proxy for GeckoFX so that you're not tweaking anything else on the system or incurring a performance cost.
Reply all
Reply to author
Forward
0 new messages