mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-27 07:38:28 +00:00
api/core: update dispatcher when proxy is changed
This commit is contained in:
parent
5908e9da15
commit
09c42d9be0
@ -337,10 +337,12 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => {
|
||||
randomizeCiphers();
|
||||
setInterval(randomizeCiphers, 1000 * 60 * 30); // shuffle ciphers every 30 minutes
|
||||
|
||||
// TODO: remove env.externalProxy in a future version
|
||||
setGlobalDispatcher(
|
||||
new EnvHttpProxyAgent({ httpProxy: env.externalProxy || undefined })
|
||||
);
|
||||
env.subscribe('externalProxy', () => {
|
||||
// TODO: remove env.externalProxy in a future version
|
||||
setGlobalDispatcher(
|
||||
new EnvHttpProxyAgent({ httpProxy: env.externalProxy || undefined })
|
||||
);
|
||||
});
|
||||
|
||||
http.createServer(app).listen({
|
||||
port: env.apiPort,
|
||||
|
Loading…
Reference in New Issue
Block a user