mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 19:30:42 +00:00
被控端 - 修复 MTU 问题:夹 MSS + 路径 MTU 探测(公网可用率 48% -> 100%) - 复用 HTTP 连接(免掉每次新建 TLS 的 30% 握手失败) - 每分钟回头找局域网,自动切回快 400 倍的路径 - 画面心跳帧:静止时省流量,客户端仍知道流是活的 - 锁屏时给出可操作的提示 手表端 - 内置 GTS Root R4 / GlobalSign Root CA,修 SSLHandshakeException - 连接错误翻译成人话(证书/时间/解析/超时分别提示) - 经中转连上后用服务器报的地址刷新已配对记录 - 新增局域网连接页面、服务器延迟检测 服务器端 - 支持 chunked 请求体(修每 16 秒一次的连接错乱与大面积 502) - 网络调优脚本 net-tune.sh(开机自动应用) - 管理页:批量删除、网络体检、下载区 - 隧道改 HTTP/2 + 双连接 文档 - 许可协议 / 安装前必读 / 安装后须知(作者:小麦子)
52 lines
1.8 KiB
Bash
52 lines
1.8 KiB
Bash
#!/bin/bash
|
|
# 为什么公网 GET 能通、POST 登记却是空响应?
|
|
#
|
|
# 被控端真正走的是 POST /v1/agent/register。
|
|
# 如果 POST 过不去,整个中转就是废的。
|
|
set -u
|
|
|
|
URL=https://relay.xxmxxs.top
|
|
BODY='{"deviceId":"diag-2","code":"482222","name":"诊断","version":"1.4.0"}'
|
|
|
|
echo "===== 1. 本地 POST(对照,应该秒回)====="
|
|
timeout 10 curl -s -H 'User-Agent: LanRemote/1.4.0' \
|
|
-H 'Content-Type: application/json' -d "$BODY" \
|
|
http://127.0.0.1:8080/v1/agent/register 2>&1 | head -c 200
|
|
echo
|
|
|
|
echo
|
|
echo "===== 2. 公网 POST,连打 6 次,看每次的结果 ====="
|
|
for i in $(seq 1 6); do
|
|
C=$(timeout 25 curl -4 -s -o /tmp/post_out.txt -w '%{http_code}' \
|
|
-H 'User-Agent: LanRemote/1.4.0' \
|
|
-H 'Content-Type: application/json' -d "$BODY" \
|
|
"$URL/v1/agent/register" 2>/tmp/post_err.txt)
|
|
C=${C:-000}
|
|
printf " %d) HTTP %-4s 响应=%s\n" "$i" "$C" \
|
|
"$(head -c 90 /tmp/post_out.txt 2>/dev/null)"
|
|
if [ -s /tmp/post_err.txt ]; then
|
|
printf " 错误: %s\n" "$(head -c 120 /tmp/post_err.txt)"
|
|
fi
|
|
sleep 3
|
|
done
|
|
|
|
echo
|
|
echo "===== 3. 公网 GET,同样打 6 次 ====="
|
|
for i in $(seq 1 6); do
|
|
C=$(timeout 20 curl -4 -s -o /tmp/get_out.txt -w '%{http_code}' \
|
|
-H 'User-Agent: LanRemote/1.4.0' "$URL/v1/health" 2>/dev/null)
|
|
printf " %d) HTTP %-4s body=%s\n" "$i" "${C:-000}" \
|
|
"$(head -c 60 /tmp/get_out.txt 2>/dev/null)"
|
|
sleep 3
|
|
done
|
|
|
|
echo
|
|
echo "===== 4. 隧道日志里的服务端错误 ====="
|
|
grep -iE 'Serve tunnel error|failed to serve|502|origin' \
|
|
/root/lanremote-relay/tunnel.log 2>/dev/null | tail -8 | sed 's/^/ /'
|
|
|
|
echo
|
|
echo "===== 5. relay 自己的日志(有没有收到请求)====="
|
|
journalctl -u lanremote-relay --no-pager -n 12 2>/dev/null \
|
|
| grep -viE 'Started|Stopped|Consumed' | tail -8 | sed 's/^/ /'
|