Files
cors-proxy/cors_proxy.js
cnachtigall1991 4f755e40a9 initial commit
2021-10-13 09:56:45 +02:00

28 lines
636 B
JavaScript

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}/'`)
})