如何在调试ASP时在Fiddler中显示本地主机流量。网络应用程序?

时间:2022-06-17 21:01:44

How do I display localhost traffic in Fiddler while debugging an ASP.NET application?

如何在调试ASP时在Fiddler中显示localhost流量。网络应用程序?

14 个解决方案

#1


86  

try using this:

试着用这个:

http://ipv4.fiddler/folder

instead of

而不是

http://localhost/folder

this also works with ports

这也适用于端口

http://ipv4.fiddler:12345/folder

Here is link to fiddler documentation

这里是fiddler文档的链接

http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/MonitorLocalTraffic

http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/MonitorLocalTraffic

#2


48  

To make Fiddler work on localhost with IIS Express you should use this form of URL

要使Fiddler在使用IIS Express的本地主机上工作,您应该使用这种形式的URL

http://localhost.fiddler:50262/

This puts correct Host header value (localhost) which satisfies IIS Express.

这将放入满足IIS Express的正确的主机头值(localhost)。

#3


18  

Start Fiddler. Go to Tools--> Fiddler Options. Choose Connections tab. Check the 'USe PAC Script' option.

提琴手开始。转到工具——> Fiddler选项。选择连接选项卡。检查“使用PAC脚本”选项。

Now you will be able to monitor local traffic as well

现在,您还可以监视本地流量

#4


11  

For an ASP.NET web site project:

一个ASP。NET网站项目:

1) Right-click the project and select Property Pages
2) Select Start Options
3) Under the Server section, click the "Use custom server" and edit the Base URL by replacing localhost with your computer's name.

1)右键单击项目,并在Server部分下选择Property Pages 2)选择Start Options 3),单击“使用自定义服务器”,并通过用计算机的名称替换localhost来编辑基本URL。

#5


7  

Probably the easiest way to monitor traffic to localhost is to replace "localhost" with "localhost." in the browser's URL bar. E.g.

监视到localhost的通信量的最简单的方法可能是在浏览器的URL栏中将“localhost”替换为“localhost”。如。

http://localhost./MyApp/default.aspx

#6


3  

Check out this link...the 'workaround' is hacky, but it does work:

查看这个链接……“变通办法”是陈腐的,但确实管用:

Tip for using Fiddler on localhost

关于在本地主机上使用Fiddler的提示

#7


3  

You may use PC hostname instead of 127.0.0.1 or localhost

您可以使用PC主机名而不是127.0.0.1或localhost

#8


3  

Checking the "Use PAC Script" in Fiddler Options -> Connections worked for me when using IIS Express within a corporate intranet.

在Fiddler选项中检查“使用PAC脚本”——当我在企业内部网中使用IIS Express时,>连接对我很有用。

#9


3  

Using Fiddler v4:

使用v4提琴手:

  1. Check your IE proxy settings
  2. 检查你的IE代理设置

IE->Tools->Internet Options->Connections->Lan Settings

IE互联网- >工具- >选项- >连接- >局域网设置

如何在调试ASP时在Fiddler中显示本地主机流量。网络应用程序?

  1. Check your settings in Fiddler:
  2. 检查您的设置在Fiddler:

Fiddler -> Options-> Connections & Https

Fiddler ->选项->连接和Https

Check the Fiddler port, default is 8888 如何在调试ASP时在Fiddler中显示本地主机流量。网络应用程序?

检查Fiddler端口,默认是8888

  1. In Fiddler-Menu:
  2. 在Fiddler-Menu:

File -> Capture Traffic is checked

文件->捕获流量被检查

The following solution worked for me, when using a

使用a时,以下解决方案对我有效

  • HttpClient or
  • HttpClient或
  • WebClient from inside an ASP.NET application.
  • 来自ASP内部的WebClient。网络应用程序。

Web.config

. config

<system.net>
    <defaultProxy
                enabled = "true"
                useDefaultCredentials = "true">
      <proxy autoDetect="False" bypassonlocal="False" proxyaddress="http://127.0.0.1:8888" usesystemdefault="False" />
    </defaultProxy>

Code:

代码:

var resourceServerUri = new Uri("http://localhost.fiddler:YourAppServicePort");
var body = c.GetStringAsync(new Uri(resourceServerUri)).Result;



Check if your request actually reaches fiddler by customizing the Fiddler Rules script

Fiddler->Rules->Customize Rules

提琴手- > - >自定义规则

and hook into the OnBeforeRequest event:

和OnBeforeRequest事件挂钩:

static function OnBeforeRequest(oSession: Session) {

if (oSession.hostname.Contains("localhost:YourPortNumber")
{
 System.Windows.Forms.MessageBox.Show(oSession.hostname);  
} 

Or explicitly by setting a web proxy

或者通过设置web代理显式地

WebClient wc = new WebClient();

WebProxy proxy = new WebProxy();
// try one of these URIs
proxy.Address = new Uri("http://127.0.0.1:8888");
proxy.Address = new Uri("http://hostname:8888");
proxy.Address = new Uri("http://localhost.fiddler");
proxy.Address = new Uri("http://ipv4.fiddler");
// https://en.wikipedia.org/wiki/IPv6
proxy.Address = new Uri("http://ipv6.fiddler");

proxy.BypassProxyOnLocal = false; wc.Proxy = proxy;
var b = wc.DownloadString(new Uri(YourResourceServerBaseAddress));

#10


2  

Ensure that in your Fiddler Connections that localhost isn't in the "IE should bypass Fiddler for URLs that start with:" box.

确保在您的Fiddler连接中,localhost不在“IE应该绕过以:”开头的url的Fiddler。

#11


2  

You should uncheck the checkbox:

您应该取消复选框:

Bypass proxy server for local addresses

为本地地址绕过代理服务器

Located at proxy configuration of Internet Explorer.

位于Internet Explorer的代理配置中。

#12


2  

Try with http://127.0.0.1. <-- note the . at the end

尝试在http://127.0.0.1。<——请注意。结束时

So you can still connect to Casini and debug easily (I'm currently debugging page on http://127.0.0.1.:1718/login/Default.aspx ).

所以您仍然可以轻松地连接到Casini并进行调试(我目前正在调试http://127.0.0.1.:1718/login/Default页面。aspx)。

#13


2  

One of the possible solutions is remove the proxy settings in IE as follows.

一种可能的解决方案是删除IE中的代理设置,如下所示。

       IE->Tools->Internet Options->Connections->Lan Settings->

disable following

禁用后

  • Automatically detect settings
  • 自动检测设置
  • Use automatic configuration script
  • 使用自动配置脚本

#14


1  

If trying to catpure HTTPS traffic on a local machine from BizTalk using Fiddler, try using the WCF Adapter Proxy settings. I used an address of: http://localhost:8888/

如果尝试使用Fiddler从BizTalk获取本地机器上的纯HTTPS通信,请尝试使用WCF适配器代理设置。我使用的地址是:http://localhost:8888/

#1


86  

try using this:

试着用这个:

http://ipv4.fiddler/folder

instead of

而不是

http://localhost/folder

this also works with ports

这也适用于端口

http://ipv4.fiddler:12345/folder

Here is link to fiddler documentation

这里是fiddler文档的链接

http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/MonitorLocalTraffic

http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/MonitorLocalTraffic

#2


48  

To make Fiddler work on localhost with IIS Express you should use this form of URL

要使Fiddler在使用IIS Express的本地主机上工作,您应该使用这种形式的URL

http://localhost.fiddler:50262/

This puts correct Host header value (localhost) which satisfies IIS Express.

这将放入满足IIS Express的正确的主机头值(localhost)。

#3


18  

Start Fiddler. Go to Tools--> Fiddler Options. Choose Connections tab. Check the 'USe PAC Script' option.

提琴手开始。转到工具——> Fiddler选项。选择连接选项卡。检查“使用PAC脚本”选项。

Now you will be able to monitor local traffic as well

现在,您还可以监视本地流量

#4


11  

For an ASP.NET web site project:

一个ASP。NET网站项目:

1) Right-click the project and select Property Pages
2) Select Start Options
3) Under the Server section, click the "Use custom server" and edit the Base URL by replacing localhost with your computer's name.

1)右键单击项目,并在Server部分下选择Property Pages 2)选择Start Options 3),单击“使用自定义服务器”,并通过用计算机的名称替换localhost来编辑基本URL。

#5


7  

Probably the easiest way to monitor traffic to localhost is to replace "localhost" with "localhost." in the browser's URL bar. E.g.

监视到localhost的通信量的最简单的方法可能是在浏览器的URL栏中将“localhost”替换为“localhost”。如。

http://localhost./MyApp/default.aspx

#6


3  

Check out this link...the 'workaround' is hacky, but it does work:

查看这个链接……“变通办法”是陈腐的,但确实管用:

Tip for using Fiddler on localhost

关于在本地主机上使用Fiddler的提示

#7


3  

You may use PC hostname instead of 127.0.0.1 or localhost

您可以使用PC主机名而不是127.0.0.1或localhost

#8


3  

Checking the "Use PAC Script" in Fiddler Options -> Connections worked for me when using IIS Express within a corporate intranet.

在Fiddler选项中检查“使用PAC脚本”——当我在企业内部网中使用IIS Express时,>连接对我很有用。

#9


3  

Using Fiddler v4:

使用v4提琴手:

  1. Check your IE proxy settings
  2. 检查你的IE代理设置

IE->Tools->Internet Options->Connections->Lan Settings

IE互联网- >工具- >选项- >连接- >局域网设置

如何在调试ASP时在Fiddler中显示本地主机流量。网络应用程序?

  1. Check your settings in Fiddler:
  2. 检查您的设置在Fiddler:

Fiddler -> Options-> Connections & Https

Fiddler ->选项->连接和Https

Check the Fiddler port, default is 8888 如何在调试ASP时在Fiddler中显示本地主机流量。网络应用程序?

检查Fiddler端口,默认是8888

  1. In Fiddler-Menu:
  2. 在Fiddler-Menu:

File -> Capture Traffic is checked

文件->捕获流量被检查

The following solution worked for me, when using a

使用a时,以下解决方案对我有效

  • HttpClient or
  • HttpClient或
  • WebClient from inside an ASP.NET application.
  • 来自ASP内部的WebClient。网络应用程序。

Web.config

. config

<system.net>
    <defaultProxy
                enabled = "true"
                useDefaultCredentials = "true">
      <proxy autoDetect="False" bypassonlocal="False" proxyaddress="http://127.0.0.1:8888" usesystemdefault="False" />
    </defaultProxy>

Code:

代码:

var resourceServerUri = new Uri("http://localhost.fiddler:YourAppServicePort");
var body = c.GetStringAsync(new Uri(resourceServerUri)).Result;



Check if your request actually reaches fiddler by customizing the Fiddler Rules script

Fiddler->Rules->Customize Rules

提琴手- > - >自定义规则

and hook into the OnBeforeRequest event:

和OnBeforeRequest事件挂钩:

static function OnBeforeRequest(oSession: Session) {

if (oSession.hostname.Contains("localhost:YourPortNumber")
{
 System.Windows.Forms.MessageBox.Show(oSession.hostname);  
} 

Or explicitly by setting a web proxy

或者通过设置web代理显式地

WebClient wc = new WebClient();

WebProxy proxy = new WebProxy();
// try one of these URIs
proxy.Address = new Uri("http://127.0.0.1:8888");
proxy.Address = new Uri("http://hostname:8888");
proxy.Address = new Uri("http://localhost.fiddler");
proxy.Address = new Uri("http://ipv4.fiddler");
// https://en.wikipedia.org/wiki/IPv6
proxy.Address = new Uri("http://ipv6.fiddler");

proxy.BypassProxyOnLocal = false; wc.Proxy = proxy;
var b = wc.DownloadString(new Uri(YourResourceServerBaseAddress));

#10


2  

Ensure that in your Fiddler Connections that localhost isn't in the "IE should bypass Fiddler for URLs that start with:" box.

确保在您的Fiddler连接中,localhost不在“IE应该绕过以:”开头的url的Fiddler。

#11


2  

You should uncheck the checkbox:

您应该取消复选框:

Bypass proxy server for local addresses

为本地地址绕过代理服务器

Located at proxy configuration of Internet Explorer.

位于Internet Explorer的代理配置中。

#12


2  

Try with http://127.0.0.1. <-- note the . at the end

尝试在http://127.0.0.1。<——请注意。结束时

So you can still connect to Casini and debug easily (I'm currently debugging page on http://127.0.0.1.:1718/login/Default.aspx ).

所以您仍然可以轻松地连接到Casini并进行调试(我目前正在调试http://127.0.0.1.:1718/login/Default页面。aspx)。

#13


2  

One of the possible solutions is remove the proxy settings in IE as follows.

一种可能的解决方案是删除IE中的代理设置,如下所示。

       IE->Tools->Internet Options->Connections->Lan Settings->

disable following

禁用后

  • Automatically detect settings
  • 自动检测设置
  • Use automatic configuration script
  • 使用自动配置脚本

#14


1  

If trying to catpure HTTPS traffic on a local machine from BizTalk using Fiddler, try using the WCF Adapter Proxy settings. I used an address of: http://localhost:8888/

如果尝试使用Fiddler从BizTalk获取本地机器上的纯HTTPS通信,请尝试使用WCF适配器代理设置。我使用的地址是:http://localhost:8888/