File size: 579 Bytes
97b4c9b
 
 
8db509b
56643f6
97b4c9b
77b902e
 
5c14de1
8db509b
9aff024
 
 
46c6bef
9aff024
97b4c9b
 
 
9aff024
 
97b4c9b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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'] = '174.192.131.169';
    return proxyReqOpts;
  },
}));

app.listen(port, () => {
  console.log(`GRP`);
});