Update server.js
Browse files
server.js
CHANGED
@@ -4,21 +4,20 @@ const app = express();
|
|
4 |
const targetUrl = 'https://www.bing.com';
|
5 |
const port = 7860;
|
6 |
const baseUrl = 'bing';
|
|
|
7 |
|
8 |
app.use('/', proxy(targetUrl, {
|
9 |
https: true,
|
10 |
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
|
11 |
//console.log(srcReq);
|
12 |
// Modify the request headers if necessary
|
13 |
-
proxyReqOpts.headers['x-forwarded-for'] =
|
14 |
proxyReqOpts.headers['x-forwarded-proto'] = 'https';
|
15 |
proxyReqOpts.headers['x-forwarded-host'] = srcReq.headers['host'];
|
16 |
proxyReqOpts.headers['via'] = '1.1 example-proxy';
|
17 |
-
proxyReqOpts.headers['forwarded'] = `for
|
18 |
-
|
19 |
-
|
20 |
-
proxyReqOpts.headers['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36';
|
21 |
-
// Пример изменения Referer
|
22 |
proxyReqOpts.headers['referer'] = 'https://www.bing.com/images/create';
|
23 |
|
24 |
return proxyReqOpts;
|
|
|
4 |
const targetUrl = 'https://www.bing.com';
|
5 |
const port = 7860;
|
6 |
const baseUrl = 'bing';
|
7 |
+
const IP = '51.15.106.132';
|
8 |
|
9 |
app.use('/', proxy(targetUrl, {
|
10 |
https: true,
|
11 |
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
|
12 |
//console.log(srcReq);
|
13 |
// Modify the request headers if necessary
|
14 |
+
proxyReqOpts.headers['x-forwarded-for'] = IP;
|
15 |
proxyReqOpts.headers['x-forwarded-proto'] = 'https';
|
16 |
proxyReqOpts.headers['x-forwarded-host'] = srcReq.headers['host'];
|
17 |
proxyReqOpts.headers['via'] = '1.1 example-proxy';
|
18 |
+
proxyReqOpts.headers['forwarded'] = `for=${IP};proto=https`;
|
19 |
+
|
20 |
+
proxyReqOpts.headers['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36';
|
|
|
|
|
21 |
proxyReqOpts.headers['referer'] = 'https://www.bing.com/images/create';
|
22 |
|
23 |
return proxyReqOpts;
|