From 6d229abfb240fcb52769f64b5d4a301f7f4da03f Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sun, 11 Oct 2026 20:17:38 +0800 Subject: [PATCH] =?UTF-8?q?change(mirror):=20=E6=92=A4=E6=8E=89=20/ws=5Fho?= =?UTF-8?q?ok.js=20=E8=B7=AF=E7=94=B1=E4=B8=8E=20index.html=20=E5=BC=95?= =?UTF-8?q?=E5=85=A5=EF=BC=8C=E6=81=A2=E5=A4=8D=E9=BB=98=E8=AE=A4=E6=97=A0?= =?UTF-8?q?=20hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - serve.js 删除 /ws_hook.js 路由,该路径回落 404(sockets/ws_hook.js 文件保留在仓库,需要时再加回路由) - index.html(本地,未入库)去掉 ws_hook 的 script 引入 --- 3DTank/tools/serve.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/3DTank/tools/serve.js b/3DTank/tools/serve.js index b180cf2..d094a4e 100644 --- a/3DTank/tools/serve.js +++ b/3DTank/tools/serve.js @@ -208,23 +208,6 @@ const Server = http.createServer((Req, Res) => { }).end(Sw); return; } - // /ws_hook.js:页面内 window.WebSocket 抓包脚本(在主脚本之前引入)。 - // 传输仍由浏览器发起(服务端看不到差别),用于与中继转存做逐帧对比;#nohook 可关闭。 - if (UrlPath.split('?')[0] === '/ws_hook.js') { - const HookFile = path.join(ROOT, 'sockets', 'ws_hook.js'); - if (!fs.existsSync(HookFile)) { - Res.writeHead(404, { 'Content-Type': 'text/plain; charset=utf-8' }).end('ws_hook.js not found'); - return; - } - const Hook = fs.readFileSync(HookFile); - Res.writeHead(200, { - 'Content-Type': 'application/javascript; charset=utf-8', - 'Content-Length': Hook.length, - 'Cache-Control': 'no-cache', - 'X-Hornet-WsHook': 'local', - }).end(Hook); - return; - } // /config.xml 本地覆盖:存在 local/config.xml 时用它,把游戏指向本地 wss_server if (!REAL_CONFIG && UrlPath.split('?')[0] === '/config.xml' && fs.existsSync(LOCAL_CONFIG)) { const Conf = fs.readFileSync(LOCAL_CONFIG);