Skip to content

Instantly share code, notes, and snippets.

@Marsup
Created October 31, 2013 21:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marsup/7257446 to your computer and use it in GitHub Desktop.
Save Marsup/7257446 to your computer and use it in GitHub Desktop.
Hapi reverse proxy
var Hapi = require('hapi');
var server = new Hapi.Server('0.0.0.0', 3000);
server.route({
method: '*',
path: '/{path*}',
handler: {
proxy: {
host: 'amazon.com',
port: 80,
protocol: 'http',
passThrough: true,
redirects: 5
}
}
});
server.start(function() {
console.log(server.info.uri);
});
@nico-onmap
Copy link

I am getting an error when running this: Error: unkwnown handler: proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment