#5 只分了数据面(geoip/geosite-cn 路由 direct),DNS 仍 final:remote 全量经隧道 解析 → 国内域名解析到非 CN IP、漏过 geoip-cn 又走隧道(白盒实测国内 TLS 1000-1660ms;修后 ~50ms)。 - clientconfig.go: 开分流时 dns.rules 加 {rule_set:[geosite-cn]→local},国内域名 用 local(223.5.5.5)直连解析 → 拿到真 CN IP → geoip-cn 命中直连 - main.go: PANGOLIN_PUBLIC_URL 缺失时启动告警(空则分流静默跳过,是隐蔽坑) - nodes.go: connect 渲染加可观测日志(split_cn/rules_base/split_active/bytes) - diag.go: 新增只读端点 GET /v1/diag/egress?host=X,节点侧量出海段耗时(白名单 防 SSRF、只回耗时数字),供白盒拆「接入段 vs 出海段」 验证:go test(splitCN 开渲染 dns.rules→local、关无 dns.rules)+ go vet;cara 实测国内 TLS 1000ms+→~50ms、接入段占 TLS 握手 ~98%。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package httpapi
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -186,6 +187,10 @@ func (a *NodeAPI) ConnectNode(w http.ResponseWriter, r *http.Request) {
|
||||
apierr.WriteJSON(w, http.StatusInternalServerError, apierr.ErrInternal)
|
||||
return
|
||||
}
|
||||
// 可观测:国内分流是否真正生效(split_active=两个条件都满足才渲染 rule_set)。
|
||||
slog.Info("client config rendered", "node", nodeUUID, "split_cn", splitCN,
|
||||
"rules_base_set", a.rulesBaseURL != "",
|
||||
"split_active", splitCN && a.rulesBaseURL != "", "bytes", len(cfgJSON))
|
||||
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
_, _ = w.Write(cfgJSON)
|
||||
|
||||
Reference in New Issue
Block a user