diff --git a/lib/core/proxy.js b/lib/core/proxy.js index c4e00c567..60054a421 100644 --- a/lib/core/proxy.js +++ b/lib/core/proxy.js @@ -14,6 +14,10 @@ exports.serve = function(ipc, host, port, ws){ ws: ws }); + proxy.on('error', function (err, req, res) { + proxy.close(); + }); + proxy.on('proxyRes', (proxyRes) => { let resBody = []; proxyRes.on('data', (b) => resBody.push(b)); diff --git a/templates/boilerplate/config/blockchain.json b/templates/boilerplate/config/blockchain.json index b72f107a1..f80d68c6d 100644 --- a/templates/boilerplate/config/blockchain.json +++ b/templates/boilerplate/config/blockchain.json @@ -12,6 +12,7 @@ "rpcHost": "localhost", "rpcPort": 8545, "rpcCorsDomain": "auto", + "proxy": true, "account": { "password": "config/development/password" }, diff --git a/templates/demo/config/blockchain.json b/templates/demo/config/blockchain.json index 8e299188a..9b7162c0d 100644 --- a/templates/demo/config/blockchain.json +++ b/templates/demo/config/blockchain.json @@ -12,6 +12,7 @@ "rpcHost": "localhost", "rpcPort": 8545, "rpcCorsDomain": "auto", + "proxy": true, "account": { "password": "config/development/password" },