gemwrp / server.js
waxihiv547's picture
Update server.js
aeff981 verified
raw
history blame contribute delete
571 Bytes
const express = require('express');
const proxy = require('express-http-proxy');
const app = express();
const targetUrl = 'https://generativelanguage.googleapis.com';
const port = 7860;
// app.use(express.json({ limit: '10mb' }));
// app.use(express.urlencoded({ limit: '10mb', extended: true }));
app.use('/', proxy(targetUrl, {
https: true,
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
// console.log(srcReq);
proxyReqOpts.headers['x-forwarded-for'] = '1.1.1.1';
return proxyReqOpts;
},
}));
app.listen(port, () => {
console.log(`GRP`);
});