Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A simple NodeJS application that acts as a CORS proxy server
// Heroku defines the environment variable PORT, and requires the binding address to be
var host = process.env.PORT ? '' : '';
var port = process.env.PORT || 2337;
var cors_proxy = require('cors-anywhere');
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