diff --git a/packages/xo-server/src/xo-mixins/http.mjs b/packages/xo-server/src/xo-mixins/http.mjs index d2b7a4fd3..efe6bebfc 100644 --- a/packages/xo-server/src/xo-mixins/http.mjs +++ b/packages/xo-server/src/xo-mixins/http.mjs @@ -16,12 +16,14 @@ export default class Http { return this._agent } - constructor(_, { config: { httpProxy, noProxy } }) { - if (httpProxy !== undefined) { - this._hasOwnHttpProxy = true + constructor(app) { + app.config.watch(({ httpProxy, noProxy }) => { + if (httpProxy !== undefined) { + this._hasOwnHttpProxy = true - this.setHttpProxy(httpProxy, noProxy) - } + this.setHttpProxy(httpProxy, noProxy) + } + }) } httpRequest(...args) {