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,
|
||||
logger: this.logger,
|
||||
plugins: this.plugins
|
||||
})
|
||||
.serve(
|
||||
this.host,
|
||||
this.rpcPort,
|
||||
);
|
||||
});
|
||||
|
||||
this.httpProxy.serve(this.host, this.rpcPort);
|
||||
this.logger.info(`HTTP Proxy for node endpoint ${endpoint} listening on ${buildUrl("http", this.host, this.rpcPort, "rpc")}`);
|
||||
|
||||
if (this.isWs) {
|
||||
this.wsProxy = await new Proxy({
|
||||
events: this.events,
|
||||
isWs: true,
|
||||
logger: this.logger,
|
||||
plugins: this.plugins
|
||||
})
|
||||
.serve(
|
||||
this.host,
|
||||
this.wsPort,
|
||||
);
|
||||
});
|
||||
|
||||
this.wsProxy.serve(this.host, this.wsPort);
|
||||
this.logger.info(`WS Proxy for node endpoint ${endpoint} listening on ${buildUrl("ws", this.host, this.wsPort, "ws")}`);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue