Skip to content

Instantly share code, notes, and snippets.

@FLYBYME
Created October 31, 2011 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FLYBYME/1327138 to your computer and use it in GitHub Desktop.
Save FLYBYME/1327138 to your computer and use it in GitHub Desktop.
var bouncy = require('bouncy');
module.exports = function(evn) {
bouncy(function(req, bounce) {
try {
if(evn.domains.hasOwnProperty(req.headers.host)) {
bounce(evn.domains[req.headers.host].port);
} else if(evn.cdn.hosts.hasOwnProperty(req.headers.host)) {
bounce(evn.cdn.hosts[req.headers.host].port);
}
} catch(err) {
console.log(err)
}
}).listen(evn.masterPort);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment