使用Fiddler通过C#从任何浏览器显示请求的URL [英] Display the requested URL from any browser through C# using Fiddler

查看:144
本文介绍了使用Fiddler通过C#从任何浏览器显示请求的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的C#控制台应用程序仅显示来自任何浏览器的请求的URL 。之前我开始使用 SharpPcap ,但我在一个网址上收到了很多IP地址,无法过滤并且只显示请求的网址。然后我切换到 Fiddler 并使用简单的fiddler代码开始。代码如下:

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);
}





现在,我的系统不使用任何代理。运行此代码后,只要我在任何浏览器中输入URL,它就会显示URL但更改我的代理设置并且没有浏览器可以打开任何进一步说代理服务器拒绝连接的网站。切换FiddlerApplication.Startup的第二个和第三个参数不会让Fiddler正常工作以获取URL。我想要一个全局解决方案,并且不想更改系统代理设置,但是想要所有的URL,这样代码就可以在任何机器上运行,而不管其原始代理设置如何并且不妨碍它。



非常感谢任何形式的帮助。请帮助。



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.

推荐答案

没有你定义的参数的解决方案。



你是什么不要得到的是小提琴是一个代理服务器!必须更改浏览器代理设置才能工作。



您唯一的解决方案是代理服务器。没有办法,所有代理都要求更改浏览器设置。
There is no solution with the parameters you've defined.

What you don't get is that Fiddle IS A PROXY SERVER! It MUST change the browser proxy settings in order to work.

Your ONLY solution is a proxy server. There is no way around that and all proxies require that the browser settings be changed.


这篇关于使用Fiddler通过C#从任何浏览器显示请求的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆