diff --git a/lib/modules/blockchain_process/blockchain.js b/lib/modules/blockchain_process/blockchain.js index 90e4a1619..4cb42eaad 100644 --- a/lib/modules/blockchain_process/blockchain.js +++ b/lib/modules/blockchain_process/blockchain.js @@ -93,13 +93,17 @@ Blockchain.prototype.initProxy = function() { this.config.wsPort += constants.blockchain.servicePortOnProxy; }; -Blockchain.prototype.setupProxy = function() { +Blockchain.prototype.setupProxy = async function() { const proxy = require('./proxy'); const Ipc = require('../../core/ipc'); let ipcObject = new Ipc({ipcRole: 'client'}); - this.rpcProxy = proxy.serve(ipcObject, this.config.rpcHost, this.config.rpcPort, false); - this.wsProxy = proxy.serve(ipcObject, this.config.wsHost, this.config.wsPort, true); + const [rpcProxy, wsProxy] = await Promise.all([ + 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() {