Improvement: include longer auto-select timeout in http agent options

This commit is contained in:
shamoon
2025-12-03 11:48:07 -08:00
parent 307d7f4b2d
commit 303a542e6e

View File

@@ -111,7 +111,7 @@ export async function cachedRequest(url, duration = 5, ua = "homepage") {
export async function httpProxy(url, params = {}) {
const constructedUrl = new URL(url);
const disableIpv6 = process.env.HOMEPAGE_PROXY_DISABLE_IPV6 === "true";
const agentOptions = disableIpv6 ? { family: 4, autoSelectFamily: false } : {};
const agentOptions = disableIpv6 ? { family: 4, autoSelectFamily: false } : { autoSelectFamilyAttemptTimeout: 500 };
let request = null;
if (constructedUrl.protocol === "https:") {