A simple NodeJS application that acts as a CORS proxy server
This file contains 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
// Heroku defines the environment variable PORT, and requires the binding address to be 0.0.0.0 | |
var host = process.env.PORT ? '0.0.0.0' : '127.0.0.1'; | |
var port = process.env.PORT || 2337; | |
var cors_proxy = require('cors-anywhere'); | |
cors_proxy.createServer({ | |
originWhitelist: [], // Allow all origins | |
//requireHeader: ['origin', 'x-subject-token'], | |
}).listen(port, host, function() { | |
console.log('Running CORS Anywhere on ' + host + ':' + port); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment