warp / server.js
waxihiv547's picture
Update server.js
196b3e4 verified
raw
history blame contribute delete
466 Bytes
const express = require('express');
const proxy = require('express-http-proxy');
const app = express();
const targetUrl = 'https://api.wolframalpha.com';
const port = 7860;
app.use('/', proxy(targetUrl, {
https: true,
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
// console.log(srcReq, proxyReqOpts);
proxyReqOpts.headers['x-forwarded-for'] = '98.102.88.158';
return proxyReqOpts;
},
}));
app.listen(port, () => {
console.log(`WARP`);
});