Skip to content

Commit

Permalink
use IPv4 family to resolve ECONNREFUSED on node
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Oct 1, 2023
1 parent 6fc5200 commit 1ad91a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/js/common/HttpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class HttpClient {
static _getHttpAgent() {
if (!HttpClient.HTTP_AGENT) {
let http = require('http');
HttpClient.HTTP_AGENT = new http.Agent({keepAlive: true});
HttpClient.HTTP_AGENT = new http.Agent({keepAlive: true, family: 4}); // use IPv4
}
return HttpClient.HTTP_AGENT;
}
Expand All @@ -183,7 +183,7 @@ class HttpClient {
static _getHttpsAgent() {
if (!HttpClient.HTTPS_AGENT) {
let https = require('https');
HttpClient.HTTPS_AGENT = new https.Agent({keepAlive: true});
HttpClient.HTTPS_AGENT = new https.Agent({keepAlive: true, family: 4}); // use IPv4
}
return HttpClient.HTTPS_AGENT;
}
Expand Down

0 comments on commit 1ad91a3

Please sign in to comment.