mirror of
https://github.com/imputnet/cobalt.git
synced 2026-08-04 07:11:04 +00:00
api/core: update dispatcher when proxy is changed
This commit is contained in:
parent
5908e9da15
commit
09c42d9be0
1 changed files with 6 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue