简体   繁体   English

如何区分代理和端点作为连接超时的来源?

[英]How to distinguish between proxy and endpoint as source of connection timeout?

When I try to connect to a server (website) through a proxy, sometimes I get "Connect timeout" errors.当我尝试通过代理连接到服务器(网站)时,有时会出现“连接超时”错误。 How can I determine whether the failed connection was to the proxy or to the endpoint?如何确定失败的连接是到代理还是到端点? I don't have access to logs on the proxy or endpoint.我无权访问代理或端点上的日志。

My use case is evaluating proxies by accessing a proxy judge web page.我的用例是通过访问代理法官网页来评估代理。 It may be that the judge is overloaded.可能是法官超负荷了。 Or it may be that the proxy no longer works.或者可能是代理不再起作用。 If the judge is overloaded I want to back off, if the proxy is broken, I want to stop using it.如果判断超载我想退出,如果代理坏了我想停止使用它。

perl -MNet::HTTP -e 'Net::HTTP->new( Host => "HOSTNAME:PORT", Timeout => 5 ) && print "OK\n"'

这会向位于 HOSTNAME:PORT 的服务器发出一个 CONNECT 并在 CONNECT 成功时打印 OK。

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

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