mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
Enable autoSelectFamily
for http(s) requests (#2214)
This commit is contained in:
parent
241c981444
commit
0c8c759f8a
@ -85,16 +85,20 @@ export async function httpProxy(url, params = {}) {
|
||||
|
||||
let request = null;
|
||||
if (constructedUrl.protocol === "https:") {
|
||||
const httpsAgent = new https.Agent({
|
||||
rejectUnauthorized: false,
|
||||
});
|
||||
|
||||
request = httpsRequest(constructedUrl, {
|
||||
agent: httpsAgent,
|
||||
agent: new https.Agent({
|
||||
rejectUnauthorized: false,
|
||||
autoSelectFamily: true,
|
||||
}),
|
||||
...params,
|
||||
});
|
||||
} else {
|
||||
request = httpRequest(constructedUrl, params);
|
||||
request = httpRequest(constructedUrl, {
|
||||
agent: new http.Agent({
|
||||
autoSelectFamily: true,
|
||||
}),
|
||||
...params,
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user