Fiddler doesn't capture traffic from Chrome

筅森魡賤 提交于 2020-01-06 07:09:31

问题


Here is what I have to do :

  1. Open a url in IE/Chrome/Firefox browser.
  2. Do some UI user action (click/submit).
  3. Record http request for a particular http call.

Here is what I did: console application + selenium RC to open url & do the user actions + Fiddler Core to capture that http traffic.

My code works fine when I'm running it in Firefox & IE, but don't know why Fiddler Core not able to capture any http traffic when running it against Chrome.

        ISelenium selenium = new DefaultSelenium("localhost", 4444, "*googlechrome", "http://money.msn.com/");
        selenium.Start();
        selenium.Open("/");
        selenium.WaitForPageToLoad("30000");

Another intersting thing, if I dont use Selenium RC & open Chrome using Process class then I can see fiddler core capturing that http request. But I need a UI automation tool to do the user actions.

Any help will be greatly appriciated.

Thanks.


回答1:


I hope I do not misinterpret the problem -- I assume localhost traffic to be the thing that cannot be captured.

localhost traffic is routed via the local loopback interface (a 'virtual' interface that routes local traffic more efficiently), and this never reaches a network card. Most packet capture tools capture the packets on the network device driver layer and thus only capture packets that actually go throug physical network devices.




回答2:


I use the following way to pass proxy and it is working for me.

ChromeOptions options = new ChromeOptions();
options.AddArgument(string.Format("--proxy-server=http={0}:{1};https={0}:{1}", proxyHost, port));
driver = new ChromeDriver(options);



回答3:


Anyway, use ipv4.fiddler instead of localhost to ensure fiddler is able to capture the traffic.

For IE, if you are using IE9, it has been changed to allow proxy connections to localhost. It seems FF is also capable to do this. Check this URL:

Fiddler and the IE9 Release Candidate http://blogs.msdn.com/b/fiddler/archive/2011/02/10/fiddler-is-better-with-internet-explorer-9.aspx

*IE9 RC introduces the ability to proxy loopback traffic. To do so, simply include the token <-loopback> (pronounced “minus-loopback”) in the proxy bypass list. When WinINET encounters this token in the bypass list, it will remove the loopback addresses (localhost, 127.0.0.1) from the list of hosts that bypass the proxy. Fiddler 2.3 and above automatically set this option when capturing traffic.

The FiddlerHook add-on automatically sets the equivalent version of this option for Firefox; for Opera, you can manually remove loopback addresses from the proxy-bypass list.*



来源:https://stackoverflow.com/questions/5740313/fiddler-doesnt-capture-traffic-from-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!