async setupProxy
This commit is contained in:
parent
b9975668b8
commit
35c772d727
|
@ -93,13 +93,17 @@ Blockchain.prototype.initProxy = function() {
|
||||||
this.config.wsPort += constants.blockchain.servicePortOnProxy;
|
this.config.wsPort += constants.blockchain.servicePortOnProxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockchain.prototype.setupProxy = function() {
|
Blockchain.prototype.setupProxy = async function() {
|
||||||
const proxy = require('./proxy');
|
const proxy = require('./proxy');
|
||||||
const Ipc = require('../../core/ipc');
|
const Ipc = require('../../core/ipc');
|
||||||
|
|
||||||
let ipcObject = new Ipc({ipcRole: 'client'});
|
let ipcObject = new Ipc({ipcRole: 'client'});
|
||||||
this.rpcProxy = proxy.serve(ipcObject, this.config.rpcHost, this.config.rpcPort, false);
|
const [rpcProxy, wsProxy] = await Promise.all([
|
||||||
this.wsProxy = proxy.serve(ipcObject, this.config.wsHost, this.config.wsPort, true);
|
proxy.serve(ipcObject, this.config.rpcHost, this.config.rpcPort, false),
|
||||||
|
proxy.serve(ipcObject, this.config.wsHost, this.config.wsPort, true, this.config.wsOrigins)
|
||||||
|
]);
|
||||||
|
this.rpcProxy = rpcProxy;
|
||||||
|
this.wsProxy = wsProxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockchain.prototype.shutdownProxy = function() {
|
Blockchain.prototype.shutdownProxy = function() {
|
||||||
|
|
Loading…
Reference in New Issue