feat(xo-server): refresh HTTP proxy on config change
This commit is contained in:
parent
11e09e1f87
commit
2fb27b26cd
@ -16,12 +16,14 @@ export default class Http {
|
|||||||
return this._agent
|
return this._agent
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(_, { config: { httpProxy, noProxy } }) {
|
constructor(app) {
|
||||||
if (httpProxy !== undefined) {
|
app.config.watch(({ httpProxy, noProxy }) => {
|
||||||
this._hasOwnHttpProxy = true
|
if (httpProxy !== undefined) {
|
||||||
|
this._hasOwnHttpProxy = true
|
||||||
|
|
||||||
this.setHttpProxy(httpProxy, noProxy)
|
this.setHttpProxy(httpProxy, noProxy)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
httpRequest(...args) {
|
httpRequest(...args) {
|
||||||
|
Loading…
Reference in New Issue
Block a user