示例#1
0
文件: gulpfile.js 项目: Narigo/ian
function liveReloadServer() {
  liveReload.listen();

  corsProxy.createServer({
    requireHeader : ['origin', 'x-requested-with'],
    removeHeaders : ['cookie', 'cookie2']
  }).listen(settings.corsProxyPort, settings.corsProxyHost, function () {
    console.log('Running CORS Anywhere on ' + settings.corsProxyHost + ':' + settings.corsProxyPort);
  });

  gulp.watch('src/static/**', ['prepareAndReload']);
  gulp.watch('src/js/**', ['prepareAndReload']);
  gulp.watch('src/scss/**/*.scss', ['prepareAndReload']);
}
示例#2
0
文件: proxy.js 项目: SAP/openui5
/* global require */
var cors_proxy = require('cors-anywhere');

// Listen on a specific IP Address
// 0.0.0.0 equals localhost
var host = '0.0.0.0';

// Listen on a specific port, adjust if necessary
var port = 8081;

cors_proxy.createServer({
	originWhitelist: [], // Allow all origins
	requireHeader: ['origin', 'x-requested-with'],
	removeHeaders: ['cookie', 'cookie2']
}).listen(port, host, function () {
	"use strict";

	/* eslint-disable no-console */
	console.log('Running CORS Anywhere on ' + host + ':' + port);
	/* eslint-enable no-console */
});
示例#3
0
var host = process.env.PORT ? '0.0.0.0' : '127.0.0.1';
var port = process.env.PORT || 9091;
 
var cors_proxy = require('cors-anywhere');
cors_proxy.createServer({
    originWhitelist: [], // Allow all origins 
    //requireHeader: ['origin', 'x-requested-with'],
    removeHeaders: ['Origin', 'Host', 'Referer']
}).listen(port, host, function() {
    console.log('Running CORS Anywhere on ' + host + ':' + port);
});

示例#4
0
// CORS for everyone! woop!

var host = process.env.PORT ? '0.0.0.0' : '127.0.0.1';
var port = process.env.PORT || 8080;

var cors_proxy = require('cors-anywhere');
cors_proxy.createServer({
    requireHeader: ['origin','x-requested-with'],
    removeHeaders: ['cookie', 'cookie2']
}).listen(port, host, function() {
    console.log('Running CORS Anywhere on ' + host + ':' + port);
});
*
* This file is part of marc-record-merge-melindautils
*
* marc-record-merge-melindautils program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* marc-record-merge-melindautils is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
* @licend  The above is the entire license notice
* for the JavaScript code in this file.
*
*/

// Heroku defines the environment variable PORT, and requires the binding address to be 0.0.0.0 

var cors_proxy = require('cors-anywhere');

var server = cors_proxy.createServer({
  //requireHeader: ['origin', 'x-requested-with'],
  removeHeaders: ['cookie', 'cookie2']
});

module.exports = server;