redirection to localhost not working in but working in 4.6.2

2 posts, 0 answers
  1. amar
    amar avatar
    1 posts
    Member since:
    Apr 2016

    Posted 14 Aug Link to this post


    I have some redirection code in my test automation that does not work when FiddlerCore is referenced.

    When I update to 4.6.2 (through Install-Package into my .csproj) the redirection starts to work.


    1) Did something change between to 4.6.2 to affect WS traffic to localhost?

    2) Is there a better way to code this and make it work with




    I have a question in stackoverflow, fyi..


    Basically, my need is:


    Redirect https tunnel traffic to https://localhost:8444 from my prod endpoint.The CONNECT has an upgrade to WebSocket and the HTTPS traffic is through WS messages.

    My automation code:

            /// <summary>
            /// Thread function to start fiddlercore and initialize event handlers
            /// </summary>        
            private static void FiddlerMocking()
                    // Set up FiddlerCore and its handlers
                    // Hook up our callbacks
                    Fiddler.FiddlerApplication.BeforeRequest += delegate (Session session)
                        Console.WriteLine("BEGIN-" + session.fullUrl);
                        if (session.fullUrl.Contains(""))
                            if (session.HTTPMethodIs("CONNECT"))
                                log.Comment("CONNECT---" +;
                                session.oFlags["x-replywithtunnel"] = "GenerateTunnel";
                            else if (session.HTTPMethodIs("GET"))
                                log.Comment("GETBEFORE---" +;
                       = "";
                                log.Comment("GETAFTER---" +;
                            Console.WriteLine("IGNORING-" + session.fullUrl);
                            // following will not work in but will work in 4.6.2

                    Fiddler.FiddlerApplication.OnValidateServerCertificate +=

                                        new   System.EventHandler<ValidateServerCertificateEventArgs>(CheckCert);
                    Fiddler.CONFIG.IgnoreServerCertErrors = true;

                    // This is to bypass traffic related to iframe
                    Fiddler.CONFIG.sHostsThatBypassFiddler = "https://*";

                    var rand = new Random();

                    Fiddler.FiddlerApplication.Startup(rand.Next(9100, 9900),
                        FiddlerCoreStartupFlags.DecryptSSL |
                        FiddlerCoreStartupFlags.MonitorAllConnections |
                        FiddlerCoreStartupFlags.RegisterAsSystemProxy |

                    // Enable HTTPS capture and add session handlers


    Please help.



  2. Petya
    Petya avatar
    990 posts

    Posted 19 Aug Link to this post

    Hi Amrendra,

    Version was released in 2012 and yes, numerous things have changed between those two versions including improvements in the WebSocket support (take a look at the change log: My recommendation would be to upgrade to a newer version of FiddlerCore, ideally the latest 5.0 to take advantage of the most recent additions, especially since you already have the scenario you want to achieve running in a recent version.

    Progress Telerik

Back to Top