提交 c35fcf8d 编写于 作者: Q qq_41923622

Sat Feb 22 18:24:00 CST 2025 inscode

上级 0694f1e3
...@@ -138,7 +138,7 @@ const server = http.createServer(async(req, res) => { ...@@ -138,7 +138,7 @@ const server = http.createServer(async(req, res) => {
proxyDataObj.info.is_pay='1' proxyDataObj.info.is_pay='1'
console.log(proxyDataObj) console.log(proxyDataObj)
res.writeHead(200, { 'Content-Type': 'text/html;charset=utf-8' }); res.writeHead(200, { 'Content-Type': 'text/html;charset=utf-8' });
res.end(`${proxyDataObj}`); res.end(`${JSON.stringify(proxyDataObj)}`);
}else{ }else{
proxy.options.target=subdirectoryMappings.h5hunlihu; proxy.options.target=subdirectoryMappings.h5hunlihu;
req.headers['origin'] = subdirectoryMappings.shunlihu; req.headers['origin'] = subdirectoryMappings.shunlihu;
...@@ -151,7 +151,7 @@ const server = http.createServer(async(req, res) => { ...@@ -151,7 +151,7 @@ const server = http.createServer(async(req, res) => {
} }
if(new RegExp(`^\/map\/`).test(req.url)){ if(new RegExp(`^\/map`).test(req.url)){
// proxyRes.headers = // proxyRes.headers =
res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Origin', '*');
// 允许所有请求方法 // 允许所有请求方法
...@@ -170,9 +170,6 @@ res.setHeader('Access-Control-Allow-Credentials', 'true'); ...@@ -170,9 +170,6 @@ res.setHeader('Access-Control-Allow-Credentials', 'true');
// 将请求代理到目标服务器 // 将请求代理到目标服务器
proxy.web(req, res); proxy.web(req, res);
} }
}
}); });
// 监听端口 // 监听端口
const port = 9080; const port = 9080;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册