Skip to content

Instantly share code, notes, and snippets.

@Marsup

Marsup/reverse.js

Created Oct 31, 2013
Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@nico-onmap nico-onmap commented Jun 23, 2017

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

@TheAppleFreak

This comment has been minimized.

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