mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-04 09:54:42 +00:00
proxy -- canonicalHost, defaultHost
This commit is contained in:
parent
ca7a46224d
commit
f91baf73bc
@ -6,6 +6,8 @@ let commList = {};
|
|||||||
let transactions = {};
|
let transactions = {};
|
||||||
let receipts = {};
|
let receipts = {};
|
||||||
|
|
||||||
|
const {canonicalHost, defaultHost} = require('../utils/host');
|
||||||
|
|
||||||
const parseRequest = function(reqBody){
|
const parseRequest = function(reqBody){
|
||||||
let jsonO;
|
let jsonO;
|
||||||
try {
|
try {
|
||||||
@ -61,7 +63,7 @@ const parseResponse = function(ipc, resBody){
|
|||||||
exports.serve = function(ipc, host, port, ws){
|
exports.serve = function(ipc, host, port, ws){
|
||||||
let proxy = httpProxy.createProxyServer({
|
let proxy = httpProxy.createProxyServer({
|
||||||
target: {
|
target: {
|
||||||
host,
|
host: canonicalHost(host),
|
||||||
port: port + constants.blockchain.servicePortOnProxy
|
port: port + constants.blockchain.servicePortOnProxy
|
||||||
},
|
},
|
||||||
ws: ws
|
ws: ws
|
||||||
@ -121,5 +123,5 @@ exports.serve = function(ipc, host, port, ws){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
server.listen(port);
|
server.listen(port, defaultHost);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user