官方版

Monitor traffic to localhost from IE or .NET

To monitor traffic sent to http://localhost or http://127.0.0.1 from IE8 or below or the .NET Framework:

  • Use your machine name as the hostname instead of Localhost or 127.0.0.1
    For example, instead of

    1. http://localhost:8081/mytestpage.aspx

    Go to:

    1. http://machinename:8081/mytestpage.aspx

    Use one of these addresses:
    -To use the IPv4 adapter (recommended for the Visual Studio test webserver, codename: Cassini):

    1. http://ipv4.fiddler

    -To use the IPv6 adapter:

    1. http://ipv6.fiddler

    -To use localhost in the Host header:

    1. http://localhost.fiddler

    Click Rules > Customize Rules… and add this code to the Rules file:

    1. static function OnBeforeRequest(oSession:Fiddler.Session){
    2. if (oSession.HostnameIs("MYAPP")) { oSession.host = "127.0.0.1:8081"; }
    3. }

    Now, http://myapp will act as an alias for 127.0.0.1:8081
    **

    谷歌翻译版

    监视从IE或者.NET到本地主机的流量

    要监视从IE8或更低版本或.NET Framework发送到http:// localhost或http://127.0.0.1的流量,请执行以下操作:

  • 使用您的计算机名作为主机名,而不是Localhost127.0.0.1

  • 例如,不要使用
    1. http://localhost:8081/mytestpage.aspx
    转到:
    1. http://machinename:8081/mytestpage.aspx
    使用其中一个地址:
    -使用IPv4适配器(建议用于Visual Studio测试webserver,代号:Cassini):
    1. http://ipv4.fiddler
    使用IPv6适配器:
    1. http://ipv6.fiddler
    要在Host标头中使用localhost:
    1. http://localhost.fiddler
    单击 Rules > Customize Rules… 然后添加规则到文件里面
    1. static function OnBeforeRequest(oSession:Fiddler.Session){
    2. if (oSession.HostnameIs("MYAPP")) { oSession.host = "127.0.0.1:8081"; }
    3. }
    现在, http://myapp 将作为一个别名 127.0.0.1:8081