简体   繁体   中英

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。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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