Improved demo, optimized server.js for Heroku

This commit is contained in:
Rob W
2013-01-04 23:18:38 +01:00
parent 051858b480
commit 098f425d0a
2 changed files with 23 additions and 7 deletions

View File

@@ -5,7 +5,21 @@ var port = process.env.PORT || 8080;
var cors_proxy = require("./lib/cors-anywhere");
cors_proxy.createServer({
requireHeader: 'x-requested-with',
removeHeaders: ['cookie', 'cookie2']
removeHeaders: [
'cookie',
'cookie2',
// Strip Heroku-specific headers
'x-heroku-queue-wait-time',
'x-heroku-queue-depth',
'x-heroku-dynos-in-use',
'x-request-start'
],
httpProxyOptions: {
enable: {
// Do not add X-Forwarded-For, etc. headers, because Heroku already adds it.
xforward: false
}
}
}).listen(port, host, function() {
console.log('Running CORS Anywhere on ' + host + ':' + port);
});