提交 a0838734 编写于 作者: Q qq_41923622

Fri Feb 21 09:40:00 CST 2025 inscode

上级 14b2eaee
......@@ -50,7 +50,7 @@ let url= "https://h5.hunlihu.com"+proxyUrl;
options.headers['Content-Length'] = Buffer.byteLength(encodedData);
axios.post(url, encodedData, { headers:options.headers })
.then(response => {
console.log('请求成功,响应数据:', response.data);
console.log('请求成功,响应数据:', req,response.data);
resolve(response.data)
}).catch((err)=>{
reject(err)
......@@ -75,7 +75,8 @@ const subdirectoryMappings = {
'h5hunlihu': 'https://h5.hunlihu.com',
};
// 创建HTTP服务器
const server = http.createServer((req, res) => {
const server = http.createServer(async(req, res) => {
if(new RegExp(`^\/shunlihu\/`).test(req.url)){
// proxyRes.headers =
......@@ -107,7 +108,9 @@ const server = http.createServer((req, res) => {
res.setHeader('Access-Control-Allow-Credentials', 'true');
https://h5.hunlihu.com/vashow/ly/door/door/init?0.9173087912286308
if(/\/vashow\/ly\/door\/door\/init/.test(req.url)){
getProxyInfoData(req, res,req.url.replace(/^\/shunlihu/, ''))
let proxyData = await getProxyInfoData(req, res,req.url.replace(/^\/shunlihu/, ''))
res.writeHead(200, { 'Content-Type': 'text/html;charset=utf-8' });
res.end(proxyData);
}else{
proxy.options.target=subdirectoryMappings.h5hunlihu;
req.headers['origin'] = subdirectoryMappings.shunlihu;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册