Currently, I writing a nodejs server that I want to call external API via https. This is the code that I used.
1 | var request = require('request'); |
After running this code, I waited for a minute and got this error:
1 | { [Error: socket hang up] code: 'ECONNRESET' } |
Doing for many searches via google, finally I got a solution that make my day happy. I hope that bellow solution can help you too.
1 | var request = require('request'); |
The important part is agentOptions. Just add it to your request config.