Closed lounsbrough closed 5 years ago
Can you set the retry
option to 0
and try again?
With timeout set to 0, the connections fail almost instantly.
Is it a Timeout Error?
Yes.
TimeoutError: Timeout awaiting 'request' for 0ms
at ClientRequest.request.once.error (E:\nodejs\determine-max-available-ship-quantity\node_modules\got\source\request-as-event-emitter.js:163:14)
at Object.onceWrapper (events.js:273:13)
at ClientRequest.emit (events.js:187:15)
at ClientRequest.origin.emit.args [as emit] (E:\nodejs\determine-max-available-ship-quantity\node_modules\@szmarczak\http-timer\source\index.js:36:11)
at Immediate.timeoutHandler (E:\nodejs\determine-max-available-ship-quantity\node_modules\got\source\utils\timed-out.js:63:11)
at processImmediate (timers.js:634:17)
Try setting timeout
to 1000 and retry
to 0. Does it fail?
With retries set to 0, it also fails immediately.
I've found a workaround which is to reject the Promise with my own timeout. I'm going to close this issue and if it becomes a problem for me again I'll upload example code of the failure. Thanks!
Describe the bug
- Node.js version: 11.0.0
- OS & version: Windows 10 Pro
The timeout option does not seem to work when using a proxy. I'm using tunnel per the examples in the README.
Actual behavior
timeout
option set to 10000 milliseconds. Request via proxy takes > 30 seconds to timeout.Expected behavior
Request should timeout after the specified number of milliseconds.
Code to reproduce
const response = await got(url, { agent: tunnel.httpsOverHttp({ proxy: { host: proxy.host, port: proxy.port, proxyAuth: `${proxy.username}:${proxy.password}`, headers: getRequestHeaders() } }), headers: getRequestHeaders(), timeout: 10000 });
Checklist
- [x] I have read the documentation.
- [x] I have tried my code with the latest version of Node.js and Got.
How to solve it?
@shikar If you're having a similar issue to this one, please open a new issue.
Describe the bug
The timeout option does not seem to work when using a proxy. I'm using tunnel per the examples in the README.
Actual behavior
timeout
option set to 10000 milliseconds. Request via proxy takes > 30 seconds to timeout.Expected behavior
Request should timeout after the specified number of milliseconds.
Code to reproduce
Checklist