Adding proxy to config, and closing on error

This commit is contained in:
Richard Ramos 2018-06-08 16:59:33 -04:00
parent c9a2014ac7
commit a669538e70
3 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,10 @@ exports.serve = function(ipc, host, port, ws){
ws: ws ws: ws
}); });
proxy.on('error', function (err, req, res) {
proxy.close();
});
proxy.on('proxyRes', (proxyRes) => { proxy.on('proxyRes', (proxyRes) => {
let resBody = []; let resBody = [];
proxyRes.on('data', (b) => resBody.push(b)); proxyRes.on('data', (b) => resBody.push(b));

View File

@ -12,6 +12,7 @@
"rpcHost": "localhost", "rpcHost": "localhost",
"rpcPort": 8545, "rpcPort": 8545,
"rpcCorsDomain": "auto", "rpcCorsDomain": "auto",
"proxy": true,
"account": { "account": {
"password": "config/development/password" "password": "config/development/password"
}, },

View File

@ -12,6 +12,7 @@
"rpcHost": "localhost", "rpcHost": "localhost",
"rpcPort": 8545, "rpcPort": 8545,
"rpcCorsDomain": "auto", "rpcCorsDomain": "auto",
"proxy": true,
"account": { "account": {
"password": "config/development/password" "password": "config/development/password"
}, },