提交 d5c30358 编写于 作者: Q qq_41923622

Fri Feb 21 12:52:00 CST 2025 inscode

上级 ff3c0543
...@@ -61,7 +61,7 @@ return new Promise((resolve,reject)=>{ ...@@ -61,7 +61,7 @@ return new Promise((resolve,reject)=>{
}; };
// let url= "https://h5.hunlihu.com/vashow/ly/door/door/sign2"; // let url= "https://h5.hunlihu.com/vashow/ly/door/door/sign2";
let url= "https://h5.hunlihu.com"+proxyUrl; let url= "http://h5.hunlihu.com"+proxyUrl;
// 将对象格式的数据转换为 x-www-form-urlencoded 格式 // 将对象格式的数据转换为 x-www-form-urlencoded 格式
const encodedData = querystring.stringify(formData); const encodedData = querystring.stringify(formData);
...@@ -131,7 +131,7 @@ const server = http.createServer(async(req, res) => { ...@@ -131,7 +131,7 @@ const server = http.createServer(async(req, res) => {
res.setHeader('Access-Control-Allow-Credentials', 'true'); res.setHeader('Access-Control-Allow-Credentials', 'true');
https://h5.hunlihu.com/vashow/ly/door/door/init?0.9173087912286308 https://h5.hunlihu.com/vashow/ly/door/door/init?0.9173087912286308
if(/\/vashow\/ly\/door\/door\/init/.test(req.url)){ if(/\/vashow\/ly\/door\/door\/init/.test(req.url)){
let proxyData = await getProxyInfoData(req, res,req.url.replace(/^\/shunlihu/, '')) let proxyData = await getProxyInfoData(req, res,req.url.replace(/^\/h5hunlihu/, ''))
res.writeHead(200, { 'Content-Type': 'text/html;charset=utf-8' }); res.writeHead(200, { 'Content-Type': 'text/html;charset=utf-8' });
res.end(proxyData); res.end(proxyData);
}else{ }else{
...@@ -139,7 +139,7 @@ const server = http.createServer(async(req, res) => { ...@@ -139,7 +139,7 @@ const server = http.createServer(async(req, res) => {
req.headers['origin'] = subdirectoryMappings.shunlihu; req.headers['origin'] = subdirectoryMappings.shunlihu;
req.headers['referer'] = subdirectoryMappings.shunlihu; req.headers['referer'] = subdirectoryMappings.shunlihu;
req.headers['host'] = "h5.hunlihu.com"; req.headers['host'] = "h5.hunlihu.com";
req.url = req.url.replace(new RegExp(`^\/shunlihu`), ''); req.url = req.url.replace(new RegExp(`^\/h5hunlihu`), '');
// 将请求代理到目标服务器 // 将请求代理到目标服务器
proxy.web(req, res); proxy.web(req, res);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册