Request getting ESOCKETTIMEDOUT consistently when all other clients work (http://www.bestbuy.com)
See original GitHub issueHello,
very easy to reproduce and always happens!
const request = require('request');
const axios = require('axios');
const url = 'http://www.bestbuy.com/';
request({
url: url,
timeout: 5000
}, (error, response, body) => {
if (!error)
console.log(`request got ${response.statusCode}`);
else
console.error(`request got an error`, error);
});
axios.get(url).then((ret) => {
console.log(`Axios got ${ret.status}`);
});
outputs:
Axios got 200
request got an error { Error: ESOCKETTIMEDOUT
at ClientRequest.<anonymous> (/Users/amir/dev/test/testVideosFb/node_modules/request/request.js:819:19)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at ClientRequest.emit (events.js:188:7)
at Socket.emitTimeout (_http_client.js:679:10)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at Socket.emit (events.js:188:7)
at Socket._onTimeout (net.js:345:8)
at ontimeout (timers.js:380:14) code: 'ESOCKETTIMEDOUT', connect: false }
My environment is node 7.7.2/8.3.0 and request@2.81.0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:25
- Comments:6
Top Results From Across the Web
node.js - request npm module - resolve ESOCKETTIMEDOUT
I am using request npm module and making upstream requests in a loop approx 100 requests per second. The timeout has been set...
Read more >Error: ESOCKETTIMEDOUT with REST request
All of a sudden we are getting plastered with Error: ESOCKETTIMEDOUT when waiting for a response to our requests. This does not always...
Read more >How to resolve esockettimedout - Caritas Castellaneta
Simplest Example to Reproduce request({ method: 'GET', 10-Aug-2017 Request getting ESOCKETTIMEDOUT consistently when all other clients work (http://www.
Read more >Untitled
If the other side has won, L archeologo subacqueo, Media frequenza colori, ... All premier league results, Ford granada 2.8, How the click...
Read more >[Code example]-Appium and protractor just opens the app but ...
I have developed the mobile test framework using appium and protractor. When I invoke the ... passing request on via HTTP proxy [JSONWP...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found if there are too many async requests, then ESOCKETTIMEDOUT exception happens in linux. The workaround I’ve found is doing this:
setting this options to request():
Notice that after that, the timeout can be lying so you might need to increase it.
I think bestbuy.com may be blocking the request due to the default headers being sent from request. If the request is made with the same headers that the axios request is sending, it does not time out: