change(mirror): 撤掉 /ws_hook.js 路由与 index.html 引入,恢复默认无 hook

- serve.js 删除 /ws_hook.js 路由,该路径回落 404(sockets/ws_hook.js 文件保留在仓库,需要时再加回路由)

- index.html(本地,未入库)去掉 ws_hook 的 script 引入
This commit is contained in:
TermiNexus committed 2026-10-11 20:17:38 +08:00
1 parent d33e7b0eba
commit 6d229abfb2
1 file changed
-17
-17
View File
@@ -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);