initial commit ✨
This commit is contained in:
27
cors_proxy.js
Normal file
27
cors_proxy.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const cors_proxy = require('cors-anywhere')
|
||||
|
||||
const host = 'localhost'
|
||||
const port = 1337
|
||||
|
||||
cors_proxy
|
||||
.createServer({
|
||||
originWhitelist: [],
|
||||
requireHeader: ['origin', 'x-requested-with'],
|
||||
removeHeaders: [
|
||||
'cookie',
|
||||
'cookie2',
|
||||
'x-request-start',
|
||||
'x-request-id',
|
||||
'via',
|
||||
'connect-time',
|
||||
'total-route-time',
|
||||
],
|
||||
redirectSameOrigin: true,
|
||||
httpProxyOptions: {
|
||||
// Do not add X-Forwarded-For, etc. headers, because Heroku already adds it.
|
||||
xfwd: false,
|
||||
},
|
||||
})
|
||||
.listen(port, host, () => {
|
||||
console.log(`Running CORS Anywhere on 'http://${host}:${port}/'`)
|
||||
})
|
Reference in New Issue
Block a user