Im trying to make https request to a server that takes more than 5 minutes to respond. ~7 mins before any data is transmitted over the socket and about 11 mins for the request to complete. The request works fine when using Curl, but when making the request using node.js I get this error:
Error: { Error: read ECONNRESET
at exports._errnoException (util.js:1026:11)
at TLSWrap.onread (net.js:564:26) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }
The code used to make the request:
const https = require('https');
https.get({
hostname: 'xxx',
path: 'xxx',
auth: 'xxx'
},
(res) => {
res.on('data', (d) => {
process.stdout.write(d);
});
}).on('error', (e) => {
console.error(e);
});
Since the request fails after exactly 5 mins (300 seconds) I'm guessing there is some sort of timeout, but I cannot seem to find out which one or where it is. It might also be a server side timeout, but then it is strange that it works with Curl..