让Fiddler调试localhost和127.0.0.1
发布时间:2018-09-06 11:28:01 所属栏目:产品 来源:站长网
导读:今天看到Lulu的闪存问到Cookie的问题,然后引发更多问题,突然想到昨晚使用Fiddler调试是否使用gzip压缩时,发现IE7下的localhost无法被捕获了。呵呵,然后就直接搜索了Fiddler localhost,找到了原因。 Copy to Clipboard 引用的内容:[www.veryhuo.com]I
今天看到Lulu的闪存问到Cookie的问题,然后引发更多问题,突然想到昨晚使用Fiddler调试是否使用gzip压缩时,发现IE7下的localhost无法被捕获了。呵呵,然后就直接搜索了“Fiddler localhost”,找到了原因。 Copy to Clipboard![]() IE7 and the .NET Framework are hardcoded not to send requests for Localhost through proxies. Fiddler runs as a proxy. The workaround is to use your machine name as the hostname instead of Localhost or 127.0.0.1. So, for instance, rather than hitting http://localhost:8081/mytestpage.aspx, instead visit http://machinename:8081/mytestpage.aspx. Alternatively, you can use http://localhost.:8081/mytestpage.aspx (note the trailing dot after localhost). Alternatively, you can customize your Rules file like so: static function OnBeforeRequest(oSession:Fiddler.Session){ if (oSession.host.ToUpper() == "MYAPP") { oSession.host = "127.0.0.1:8081"; } } ...and then navigate to http://myapp, which will act as an alias for 127.0.0.1:8081. 我比较喜欢localhost. 方式。 如果你使用IIS7的话,还可以自己定制 Copy to Clipboard![]() <defaultProxy> <proxy proxyaddress="http://127.0.0.1:8888" /> </defaultProxy> </system.net> 这样,就会通过代理来访问了,从而Fiddler就能捕获到数据了。 最后还联想到以前DF介绍的一款Fiddler的插件,帮助我们查看被去空白的Javascript代码插件-- Fiddler2 - JavaScript Beautifier Plugin (Fiddler 2的JavaScript代码美化插件)。 呵呵,有时候想起某些事情是需要有导火线的。 (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐
热点阅读