diff --git a/index.js b/index.js index 45c89c69e860fd03ae0d4c49289b7145283cf470..9dd82035311f3db75005d6981361333621c65d02 100644 --- a/index.js +++ b/index.js @@ -138,7 +138,7 @@ const server = http.createServer(async(req, res) => { proxyDataObj.info.is_pay='1' console.log(proxyDataObj) res.writeHead(200, { 'Content-Type': 'text/html;charset=utf-8' }); - res.end(`${proxyDataObj}`); + res.end(`${JSON.stringify(proxyDataObj)}`); }else{ proxy.options.target=subdirectoryMappings.h5hunlihu; req.headers['origin'] = subdirectoryMappings.shunlihu; @@ -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 = res.setHeader('Access-Control-Allow-Origin', '*'); // 允许所有请求方法 @@ -170,9 +170,6 @@ res.setHeader('Access-Control-Allow-Credentials', 'true'); // 将请求代理到目标服务器 proxy.web(req, res); } - - -} }); // 监听端口 const port = 9080;