mirror of
https://github.com/seerr-team/seerr.git
synced 2026-02-15 01:54:47 -05:00
fix(proxy): add connection limits and IPv4 support to undici agents
This commit is contained in:
@@ -14,7 +14,11 @@ export default async function createCustomProxyAgent(
|
||||
proxySettings: ProxySettings,
|
||||
forceIpv4First?: boolean
|
||||
) {
|
||||
const defaultAgent = new Agent({ keepAliveTimeout: 5000 });
|
||||
const defaultAgent = new Agent({
|
||||
keepAliveTimeout: 5000,
|
||||
connections: 50,
|
||||
connect: forceIpv4First ? { family: 4 } : undefined,
|
||||
});
|
||||
|
||||
const skipUrl = (url: string | URL) => {
|
||||
const hostname =
|
||||
@@ -68,6 +72,8 @@ export default async function createCustomProxyAgent(
|
||||
uri: proxyUrl,
|
||||
token,
|
||||
keepAliveTimeout: 5000,
|
||||
connections: 50,
|
||||
connect: forceIpv4First ? { family: 4 } : undefined,
|
||||
});
|
||||
|
||||
setGlobalDispatcher(proxyAgent.compose(noProxyInterceptor));
|
||||
|
||||
Reference in New Issue
Block a user