0

I want my C# console application to display only the requested URLs from any browser. Earlier I started with SharpPcap, but I was getting many IP addresses against one URL and could not filter and display only the requested URL. Then I switched to Fiddler and started by using simple fiddler code. The code is given below.

static void Main(String[] args)
{
    Fiddler.FiddlerApplication.BeforeRequest += sessionState =>
    {
        Console.WriteLine("URL={0}", sessionState.fullUrl);
    };

    Fiddler.FiddlerApplication.Startup(8888, true, true);

    Console.ReadLine();
    Fiddler.FiddlerApplication.Shutdown();
    System.Threading.Thread.Sleep(750);
}

Now, my system does not use any proxy. After running this code, as soon as I enter an URL in any browser, it shows the URL but changes my proxy settings and no browser can open any website further saying "The proxy server is refusing connections". Toggling the 2nd and 3rd parameters of "FiddlerApplication.Startup" does not let Fiddler work properly to get the URLs. I want a global solution and does not want to change the system proxy settings anyway, yet want all the URLs, so that the code can be run on any machine irrespective of its original proxy settings and without hampering it.

Any kind of help is highly appreciated. Please help.

4

0 回答 0