mirror of https://github.com/embarklabs/embark.git
fix(stack/proxy): ensure wsProxy and httpProxy have correct type
Both, `httpProxy` and `wsProxy` inside `Proxymanager` have been assigned the value of `new Proxy(...).serve()` which is an instance of `express`. This was wrong and causes runtime errors when proxies are being stopped as they don't have a `stop()` API.
This commit is contained in:
parent
7ae17612dd
commit
d9c8109201
|
@ -140,23 +140,20 @@ export default class ProxyManager {
|
||||||
isWs: false,
|
isWs: false,
|
||||||
logger: this.logger,
|
logger: this.logger,
|
||||||
plugins: this.plugins
|
plugins: this.plugins
|
||||||
})
|
});
|
||||||
.serve(
|
|
||||||
this.host,
|
this.httpProxy.serve(this.host, this.rpcPort);
|
||||||
this.rpcPort,
|
|
||||||
);
|
|
||||||
this.logger.info(`HTTP Proxy for node endpoint ${endpoint} listening on ${buildUrl("http", this.host, this.rpcPort, "rpc")}`);
|
this.logger.info(`HTTP Proxy for node endpoint ${endpoint} listening on ${buildUrl("http", this.host, this.rpcPort, "rpc")}`);
|
||||||
|
|
||||||
if (this.isWs) {
|
if (this.isWs) {
|
||||||
this.wsProxy = await new Proxy({
|
this.wsProxy = await new Proxy({
|
||||||
events: this.events,
|
events: this.events,
|
||||||
isWs: true,
|
isWs: true,
|
||||||
logger: this.logger,
|
logger: this.logger,
|
||||||
plugins: this.plugins
|
plugins: this.plugins
|
||||||
})
|
});
|
||||||
.serve(
|
|
||||||
this.host,
|
this.wsProxy.serve(this.host, this.wsPort);
|
||||||
this.wsPort,
|
|
||||||
);
|
|
||||||
this.logger.info(`WS Proxy for node endpoint ${endpoint} listening on ${buildUrl("ws", this.host, this.wsPort, "ws")}`);
|
this.logger.info(`WS Proxy for node endpoint ${endpoint} listening on ${buildUrl("ws", this.host, this.wsPort, "ws")}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue