| 301 | // But it also makes sense to treat the tunnel establishment timeout as |
| 302 | // a normal timeout for the request. |
| 303 | function onProxyTimeout() { |
| 304 | debug('onProxyTimeout', proxyTunnelTimeout); |
| 305 | cleanup(); |
| 306 | const err = new ERR_PROXY_TUNNEL(`Connection to establish proxy tunnel timed out after ${proxyTunnelTimeout}ms`); |
| 307 | err.proxyTunnelTimeout = proxyTunnelTimeout; |
| 308 | afterSocket(err, socket); |
| 309 | } |
| 310 | |
| 311 | if (proxyTunnelTimeout && proxyTunnelTimeout > 0) { |
| 312 | debug('proxy tunnel setTimeout', proxyTunnelTimeout); |