mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
feat: proxy setting (#1031)
* feat: add a proxy option into settings * feat: add a proxy option into settings * fix: use undici proxy agent
This commit is contained in:
@@ -38,6 +38,7 @@ import dns from 'node:dns';
|
||||
import net from 'node:net';
|
||||
import path from 'path';
|
||||
import swaggerUi from 'swagger-ui-express';
|
||||
import { ProxyAgent, setGlobalDispatcher } from 'undici';
|
||||
import YAML from 'yamljs';
|
||||
|
||||
if (process.env.forceIpv4First === 'true') {
|
||||
@@ -74,6 +75,11 @@ app
|
||||
const settings = await getSettings().load();
|
||||
restartFlag.initializeSettings(settings.main);
|
||||
|
||||
// Register HTTP proxy
|
||||
if (settings.main.httpProxy) {
|
||||
setGlobalDispatcher(new ProxyAgent(settings.main.httpProxy));
|
||||
}
|
||||
|
||||
// Migrate library types
|
||||
if (
|
||||
settings.plex.libraries.length > 1 &&
|
||||
|
||||
Reference in New Issue
Block a user