让Fiddler调试localhost和127.0.0.1

今天看到Lulu的闪存问到Cookie的问题,然后引发更多问题,突然想到昨晚使用Fiddler调试是否使用gzip压缩时,发现IE7下的localhost无法被捕获了。呵呵,然后就直接搜索了“Fiddler localhost”,找到了原因。

以下引用至:http://www.fiddlertool.com/Fiddler/help/knownissues.asp

I don't see IE7 or .NET traffic sent to localhost or 127.0.0.1.

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的话,还可以自己定制

<system.net>
  <defaultProxy>
    <proxy  proxyaddress="http://127.0.0.1:8888" />
  </defaultProxy>
</system.net>

这样,就会通过代理来访问了,从而Fiddler就能捕获到数据了。

 

最后还联想到以前DF介绍的一款Fiddler的插件,帮助我们查看被去空白的Javascript代码插件-- Fiddler2 - JavaScript Beautifier Plugin (Fiddler 2的JavaScript代码美化插件)

 

呵呵,有时候想起某些事情是需要有导火线的。

 

Technorati 标签: ,,,
posted @ 2008-03-31 16:25 MK2 阅读(198) 评论(1)  编辑 收藏 所属分类: 4 JavaScript 的世界3 Ajax In other way

  回复  引用  查看    
#1楼 2008-04-01 10:25 | Q.Lee.lulu      
偶就是强大的导火线,哈哈!!

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  博客园首页

  新闻频道

  社区

  小组

  博问

  网摘

  闪存

  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-03-31 16:39 编辑过
成果网帮您增加网站收入


相关链接: