Created
October 31, 2013 21:23
-
-
Save Marsup/7257446 to your computer and use it in GitHub Desktop.
Hapi reverse proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am getting an error when running this:
Error: unkwnown handler: proxy
.