mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 20:40:43 +00:00
阶段3 管理页 - 清掉全部深色主题残留(地址框 #0b1220、按钮悬停 #262c36、 删除按钮 #2d1214 等 11 处),现在 0 处深色 - 接口全部正常:health / downloads / netcheck 阶段4 局域网诊断 - 查清楚"电脑不在同一网络"是怎么回事:被控端是**对的** (lan_ips() 报 ['192.168.2.64', '169.254.83.107'],真实地址排第一), 是手表当时真不在 192.168.2.x —— 可能连了 5G 频段的另一个路由器,或开着移动数据 - 所以改了手表的提示:不再只说"不在同一网络", 而是把**双方地址都打出来**,用户一眼能看出是网段不同还是连错 WiFi - 端到端验证局域网路径:认证 1 ms,功能列表 207 项 阶段1 结论修正(一天内推翻自己两次,如实记录) - 第一次判断"优选 IP 无用":错。半小时内确实能避开超时 IP - 第二次固定优选 IP:也错。那些实测 138ms 的 IP 半小时后全不通了 —— Cloudflare anycast 可达性随运营商路由变化,固定 IP 等于钉死到会失效的地址 - 最终:不固定,靠 GeoDNS + cloudflared 重试 + ha-connections 2 冗余 - 撤销后立即变好:连接稳定 2 条、超时告警 0 次、设备侧延迟 4.40s -> 1.66s - **真正的瓶颈**:分段实测发现本机到 Cloudflare 的**裸 RTT 就 1439 ms**, 比经隧道的请求(1215 ms)还慢。说明瓶颈是这条网络的 4G 上行本身, 不是设备的隧道。公网侧已无优化空间。 - 局域网 118 ms vs 公网 1215 ms,快 10 倍 —— 这才是该走的路 阶段5 验收 - 全量回归 29 项全通过 - 设备侧验收 38 项全通过 - 成品:setup exe 14.37 MB / server zip / watch apk,已同步到设备下载区
45 lines
1.4 KiB
Python
45 lines
1.4 KiB
Python
# -*- coding: utf-8 -*-
|
|
r'''测被控端实际报出去的 lanIps 列表。'''
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(r"C:\Users\shu\Desktop\deepseekagent\LanRemote")
|
|
sys.path.insert(0, str(ROOT / "windows"))
|
|
|
|
|
|
def main() -> int:
|
|
from lanremote.server import lan_ips, local_ip, _ip_rank
|
|
|
|
ips = lan_ips()
|
|
print(" lan_ips() -> %s" % (ips,))
|
|
for ip in ips:
|
|
print(" %-18s rank=%d" % (ip, _ip_rank(ip)))
|
|
print()
|
|
print(" local_ip() -> %s" % local_ip())
|
|
|
|
print()
|
|
print(" 手表那边的判断(sameSubnet 比前 3 段):")
|
|
if ips:
|
|
first = ips[0]
|
|
print(" 被控端报的第一个: %s" % first)
|
|
print(" 如果手表在 192.168.2.x -> 匹配 ✓")
|
|
print(" 如果手表在别的网段 -> 不匹配,走中转")
|
|
|
|
print()
|
|
print(" 结论:")
|
|
real = [ip for ip in ips if ip.startswith(("192.168.", "10."))]
|
|
if real:
|
|
print(" ✓ 报了真实局域网地址 %s,手表同网段时能直连" % real[0])
|
|
print(" 所以「电脑不在同一网络」的提示,意味着")
|
|
print(" 手表当时**真的不在** 192.168.2.x —— 比如连了 5G 频段")
|
|
print(" 的另一个路由,或者开着移动数据。")
|
|
else:
|
|
print(" ✗ 没有真实局域网地址,手表永远匹配不上")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|