Files
ykxmz/_build/fix_reconnect_order.py
xmz7891 b62ac865ea ykxmz 1.5.0:修复手表端 TLS 证书校验 + MTU 修复网络稳定性
被控端
- 修复 MTU 问题:夹 MSS + 路径 MTU 探测(公网可用率 48% -> 100%)
- 复用 HTTP 连接(免掉每次新建 TLS 的 30% 握手失败)
- 每分钟回头找局域网,自动切回快 400 倍的路径
- 画面心跳帧:静止时省流量,客户端仍知道流是活的
- 锁屏时给出可操作的提示

手表端
- 内置 GTS Root R4 / GlobalSign Root CA,修 SSLHandshakeException
- 连接错误翻译成人话(证书/时间/解析/超时分别提示)
- 经中转连上后用服务器报的地址刷新已配对记录
- 新增局域网连接页面、服务器延迟检测

服务器端
- 支持 chunked 请求体(修每 16 秒一次的连接错乱与大面积 502)
- 网络调优脚本 net-tune.sh(开机自动应用)
- 管理页:批量删除、网络体检、下载区
- 隧道改 HTTP/2 + 双连接

文档
- 许可协议 / 安装前必读 / 安装后须知(作者:小麦子)
2026-10-06 19:01:05 +08:00

66 lines
2.1 KiB
Python

# -*- coding: utf-8 -*-
"""把重连放到重启之后。
正确的顺序应该是:
爆破测试 → 重启被控端 → **重新建立连接** → 合法配对 → 其余测试
之前重连建在爆破之前,重启后那个 socket 已经死了。
"""
from __future__ import annotations
import sys
from pathlib import Path
E2E = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote\_tests"
r"\test_e2e_features.py")
def main() -> int:
text = E2E.read_text(encoding="utf-8")
# 1. 去掉放在爆破之前的那次重连
wrong = ''' print()
print("一、配对(重启之后重新连)")
time.sleep(0.5)
client = Client("127.0.0.1", PORT)
'''
if wrong in text:
text = text.replace(wrong, ' print()\n print("一、配对")\n', 1)
print(" 已移除放错位置的重连")
# 2. 在重启确认之后建立新连接
anchor = ' check("重启后被控端重新在监听", restarted)\n time.sleep(1.0)\n'
if anchor not in text:
print(" [失败] 找不到重启确认那一行")
return 1
replacement = (anchor +
'\n'
' # 重启之后必须重新建连接(旧的 socket 已经断了)\n'
' client = Client("127.0.0.1", PORT)\n')
text = text.replace(anchor, replacement, 1)
print(" 重连已挪到重启之后")
E2E.write_text(text, encoding="utf-8")
import ast
try:
ast.parse(E2E.read_text(encoding="utf-8"))
print(" 语法 OK")
except SyntaxError as exc:
print(f" 语法错误: {exc}")
return 1
# 打印顺序确认
print()
lines = E2E.read_text(encoding="utf-8").splitlines()
for i, line in enumerate(lines):
s = line.strip()
if 'print("' in s and ("、" in s or "重启" in s):
print(f" {i+1}: {s[:70]}")
if "Client(\"127.0.0.1\", PORT)" in s and "breaker" not in s and "probe" not in s:
print(f" {i+1}: >>> {s.strip()}")
return 0
if __name__ == "__main__":
sys.exit(main())