Using Fiddler with IIS7 Express

前端 未结 4 1202
死守一世寂寞
死守一世寂寞 2020-12-13 03:58

I am using IIS7 Express while developing my web application. I need to use fiddler to investigate an issue and cannot figure out how to configure things so I can get the HT

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 04:40

    One useful variation of Eric's answer (that was edited by Brett) would be to use oSession.port to build the oSession.host. With this little change, if one needs to capture IIS express traffic on http://localhost:12345, they could use http://iisexpress:12345. That will make it easier to capture traffic for sites with random ports as created by WebMatrix and VS. I tried it out with IE and Firefox and capturing IIS Express traffic was a breeze. Fiddler rocks!.

    static function OnBeforeRequest(oSession:Fiddler.Session)
    {
       //...
       // workaround the iisexpress limitation
       // URL http://iisexpress:port can be used for capturing IIS Express traffic
       if (oSession.HostnameIs("iisexpress")) { oSession.host = "localhost:"+oSession.port; }
       //...
    }
    

提交回复
热议问题