Skip to content

Instantly share code, notes, and snippets.

@tanepiper
Created August 16, 2012 10:21
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 tanepiper/b22c21ba46f990f87f78 to your computer and use it in GitHub Desktop.
Save tanepiper/b22c21ba46f990f87f78 to your computer and use it in GitHub Desktop.
server.mount(function(req) {
if ( !req.headers['x-forwarded-for'] && /\/s.gif|\/s.json/.test(req.url) === true ) {
return true;
}
return false;
}, function(req, bounce) {
var url = 'http://' + req.headers.host + '/pb' + req.url;
bounce(url);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment