diff --git a/server/utils/customProxyAgent.ts b/server/utils/customProxyAgent.ts index 3b6223685..96ea7fed7 100644 --- a/server/utils/customProxyAgent.ts +++ b/server/utils/customProxyAgent.ts @@ -6,7 +6,7 @@ import { Agent, ProxyAgent, setGlobalDispatcher } from 'undici'; export default async function createCustomProxyAgent( proxySettings: ProxySettings ) { - const defaultAgent = new Agent(); + const defaultAgent = new Agent({ keepAliveTimeout: 5000 }); const skipUrl = (url: string) => { const hostname = new URL(url).hostname; @@ -63,6 +63,7 @@ export default async function createCustomProxyAgent( interceptors: { Client: [noProxyInterceptor], }, + keepAliveTimeout: 5000, }); setGlobalDispatcher(proxyAgent);