From c44a6b8e814074a909a4a8f92ed657f983bb8e9e Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Sun, 15 Jul 2018 19:34:33 -0500 Subject: [PATCH] proxy -- canonicalHost, defaultHost --- lib/core/proxy.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core/proxy.js b/lib/core/proxy.js index 9fb31b82..9a901889 100644 --- a/lib/core/proxy.js +++ b/lib/core/proxy.js @@ -6,6 +6,8 @@ let commList = {}; let transactions = {}; let receipts = {}; +const {canonicalHost, defaultHost} = require('../utils/host'); + const parseRequest = function(reqBody){ let jsonO; try { @@ -61,7 +63,7 @@ const parseResponse = function(ipc, resBody){ exports.serve = function(ipc, host, port, ws){ let proxy = httpProxy.createProxyServer({ target: { - host, + host: canonicalHost(host), port: port + constants.blockchain.servicePortOnProxy }, ws: ws @@ -120,6 +122,6 @@ exports.serve = function(ipc, host, port, ws){ }); } - server.listen(port); + server.listen(port, defaultHost); return server; };