简体   繁体   English

提琴手删除了传出的http连接限制?

[英]Outgoing http connection limit removed by fiddler?

I have a .net client app that opens a long running asynchronous http connection. 我有一个.net客户端应用程序,可以打开长时间运行的异步http连接。

I have two servers: one in dev and the other in staging. 我有两台服务器:一台在开发中,另一台在登台中。 In the app, I can create any number of these connections. 在应用程序中,我可以创建任意数量的这些连接。 And I am successfully able to open 50 connections to the server. 而且我能够成功打开与服务器的50个连接。 For kicks, I tried starting 4 of these apps all opening 50 connections, and I have 200 connections open to the server in dev environment, which I can observe via netstat. 对于踢,我尝试启动这些应用程序中的4个,全部打开50个连接,并且在开发环境中可以打开200个服务器连接,可以通过netstat进行观察。

When I try to do the same against staging server, I get perhaps 1 or 2 connections at most, total - doesn't matter how many instances of my app I'm running. 当我尝试对登台服务器执行相同操作时,总共最多只能获得1或2个连接-不管我运行的应用程序实例有多少。 Then I start up fiddler, and have it configured as system proxy. 然后,我启动提琴手,并将其配置为系统代理。 I then run my app and I see all of them connected. 然后,我运行我的应用程序,然后看到它们都已连接。 I look at netstat output and I indeed see all of the connections. 我看了netstat输出,确实看到了所有连接。

Here's a difference between the dev server and the staging server: staging server is behind a corporate proxy. 这是开发服务器和登台服务器之间的区别:登台服务器位于公司代理后面。 So netstat shows me that I have connection going to fiddler and a connection going to the proxy. 所以netstat告诉我,我有连接到提琴手,有连接到代理。

Here's my question. 这是我的问题。 How is fiddler letting me have 50 connections when without it, I can only get 1 or 2 connections? 小提琴手如何让我有50个连接,而没有它,我只能得到1个或2个连接? Is there something I need to configure in my client code? 我需要在客户端代码中进行配置吗?

Thanks 谢谢

Jiho 治浩

I just ran into this same problem. 我只是遇到了同样的问题。 To fix it, I set ServicePointManager.DefaultConnectionLimit = 50; 为了解决这个问题,我设置了ServicePointManager.DefaultConnectionLimit = 50; in my application code (console app). 在我的应用程序代码(控制台应用程序)中。 Note that this setting is process-wide. 请注意,此设置是整个过程的。 Prior to this setting, I had only 2 open connections (which I believe is the default) 在进行此设置之前,我只有2个打开的连接(我相信这是默认设置)

This turned out to be a proxy related. 事实证明这与代理相关。 Fiddler having proxy information, were able to get out to staging but my own .net app did not use proxy and thus "hanging". 具有代理信息的Fiddler能够进行登台,但是我自己的.net应用未使用代理,因此“挂起”。 Once I configured my requests with proxy, they were able to hit the staging servers no problem. 一旦使用代理配置了请求,它们就可以毫无问题地访问登台服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM