proxy.js 543 B

123456789101112131415
  1. // Listen on a specific host via the HOST environment variable
  2. const host = process.env.HOST || '0.0.0.0';
  3. // Listen on a specific port via the PORT environment variable
  4. const port = process.env.PROXY_PORT || 8085;
  5. const corsProxy = require('cors-anywhere');
  6. corsProxy
  7. .createServer({
  8. originWhitelist: [], // Allow all origins
  9. // requireHeader: ['origin', 'x-requested-with'],
  10. removeHeaders: ['cookie', 'cookie2'],
  11. })
  12. .listen(port, host, function () {
  13. console.log('Running CORS Anywhere on ' + host + ':' + port);
  14. });