forked from Rob--W/cors-anywhere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
45 lines (43 loc) · 984 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var host = process.env.HOST || '0.0.0.0';
var port = process.env.PORT || 8080;
function parseEnvList(env) {if (!env) {return [];}return env.split(',');}
var cors_proxy = require('./lib/cors-anywhere');
cors_proxy.createServer({
originBlacklist: [],
originWhitelist: [],
requireHeader: [],
checkRateLimit: null,
setHeaders:{
"Referer": ""
},
removeHeaders: [
'cookie',
'cookie2',
'referer',
'x-request-start',
'x-request-id',
'via',
'connect-time',
'total-route-time',
'X-Final-Url',
'X-Frame-Options',
'X-Request-Url',
'x-forwarded-for',
'x-forwarded-proto',
'x-forwarded-port',
'cdn-loop',
'do-connecting-ip',
'cf-ray',
'cf-visitor',
'cf-ew-via',
'cf-ipcountry',
'cf-connecting-ip',
'cf-worker'
],
redirectSameOrigin: true,
httpProxyOptions: {
xfwd: false,
},
}).listen(port, host, function() {
console.log('Running CORS Anywhere on ' + host + ':' + port);
});