how to detect if a network timeout received is due to the request-endpoint or something intermediate (such as a http proxy)

StackOverflow https://stackoverflow.com/questions/17380201

문제

As part of writing a crawler (in Node.js but really not the point), I sometimes receive timeouts and other network exceptions. Some exceptions (like http errorcodes) can be correctly attributed to the the targetted request-endpoint. Others, like timeouts that I configure myself are harder (impossible?) to attribute.

For instance when crawling with http proxies, how to check if exceptions (like the mentioned timeouts) are due to the proxy or due to the request-endpoint?

도움이 되었습니까?

해결책

You should be able to rely on the proxy relaying whatever it gets as fast as possible, unless it is a home-grown program, in which case anything is possible. So you should treat all timeouts as originating from the upstream server.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top