Enable `autoSelectFamily` for http(s) requests (#2214)

pull/2222/head
shamoon 1 year ago committed by GitHub
parent 241c981444
commit 0c8c759f8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -85,16 +85,20 @@ export async function httpProxy(url, params = {}) {
let request = null; let request = null;
if (constructedUrl.protocol === "https:") { if (constructedUrl.protocol === "https:") {
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
});
request = httpsRequest(constructedUrl, { request = httpsRequest(constructedUrl, {
agent: httpsAgent, agent: new https.Agent({
rejectUnauthorized: false,
autoSelectFamily: true,
}),
...params, ...params,
}); });
} else { } else {
request = httpRequest(constructedUrl, params); request = httpRequest(constructedUrl, {
agent: new http.Agent({
autoSelectFamily: true,
}),
...params,
});
} }
try { try {

Loading…
Cancel
Save