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.

Tutun
  • 79
  • 1
  • 12
  • 1
    Finding the requested URL in an HTTP request requires you to intercept that HTTP request, which requires some kind of proxy. The proxy could be on the network, sniffing traffic passing over a router or wifi network (like FireSheep), or it could be in the OS's network stack (configured as part of network connection), but it has to somehow be between the browser and the Internet. – IMSoP Aug 16 '14 at 12:32
  • FiddlerCore *is* a proxy. If you're seeing "the proxy server is refusing connections" then there's a bug in your code. – EricLaw Aug 19 '14 at 08:17

0 Answers0