Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeHitchens committed Mar 5, 2017
1 parent 64179d6 commit 353cb81
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions new_forker.js
Expand Up @@ -5,12 +5,11 @@ httpProxy = require('http-proxy');
vhost = require('vhost');
require("sleepless")

cfg = require("./config.json")

function webProxy(proxy) { return proxy.web.bind(proxy); }
webProxy = function(proxy) { return proxy.web.bind(proxy); }

cfg = require("./config.json")

var vhost_app = express();
vhost_app = express();

for(var host in cfg.forks) {

Expand All @@ -24,12 +23,11 @@ for(var host in cfg.forks) {
xfwd: true, // add x-forwarded-for header so we get the real IP
});

vhost_app.use(vhost( host, webProxy(prox)));
vhost_app.use(vhost(host, webProxy(prox)));

log("added fork: "+host+" -> "+tgt_host+":"+tgt_port);
}


var server = http.createServer(function (req, res) {
if (!req.headers.host && req.url.indexOf('://') !== -1) {
res.writeHead(500)
Expand Down

0 comments on commit 353cb81

Please sign in to comment.