feat: 路由模式重构(full/proxy/bypass) + CIDR动态URL获取 + 命中统计 + 连接稳定性修复
路由模式与CIDR配置重构: - 路由模式从 full/split/custom 改为 full/proxy/bypass,移除 split 和 custom - CIDR 按 IPv4/IPv6 分开配置,支持静态 CIDR + URL 动态获取 - URL 支持"代理前获取"(直连)和"代理后获取"(走隧道)两种时机 - 数据库迁移 v5 自动转换旧数据(custom_cidrs 拆分为 cidr_v4/v6,custom->proxy,split->full) CIDR命中统计: - 状态栏显示当前路由模式及 IPv4/IPv6 CIDR 命中数 - 代理模式: 显示命中/总数; 绕过模式: 显示已配置数 + 未命中目的地址数 - cidrTracker 在 pumpPackets 中逐包检查出站目的IP 连接稳定性修复(多轮): - transport.Connect 添加 ctx 监听 goroutine,取消时关闭WS中断阻塞的ReadMessage - auth.Login 加 context.Context 参数,可被 cancel 中断 - Disconnect() 先删路由再关TUN,避免断网窗口 - startSession 在 Connect 前释放 d.mu,避免锁持有过久 - onConnect 移除 SendStop 消除竞态 - before-proxy CIDR 获取移到 run 循环前,并行获取+5s超时,重连复用 - cidrTracker 加 RWMutex 防数据竞争 UI修复: - CIDR URL 输入框改为水平滚动+纵向布局,防止撑宽窗口 - 路由模式为full时隐藏CIDR配置区域
This commit is contained in:
+21
-4
@@ -37,6 +37,12 @@ TxV6Zero = "↑ 0 B 0 bps"
|
||||
RxTotalZero = "Total ↓ 0 B 0 bps"
|
||||
TxTotalZero = "↑ 0 B 0 bps"
|
||||
|
||||
StatusRoutingMode = "Routing Mode: {{.mode}}"
|
||||
CIDRHit = "hit"
|
||||
CIDRConfigured = "configured"
|
||||
CIDRUnmatched = "unmatched"
|
||||
CIDRDestinations = "destinations"
|
||||
|
||||
DlgNoProfileTitle = "No Profile"
|
||||
DlgNoProfileEditMsg = "Select a profile to edit."
|
||||
DlgNoProfileConnectMsg = "Please select or create a profile first."
|
||||
@@ -88,10 +94,15 @@ FieldUsername = "Username"
|
||||
FieldPassword = "Password"
|
||||
FieldAuthMode = "Auth Mode"
|
||||
FieldRoutingMode = "Routing Mode"
|
||||
FieldCustomCIDRs = "Custom CIDRs (comma-separated)"
|
||||
FieldCIDRV4 = "IPv4 CIDRs (comma-separated)"
|
||||
FieldCIDRV6 = "IPv6 CIDRs (comma-separated)"
|
||||
FieldCIDRV4URLs = "IPv4 CIDR URL Sources"
|
||||
FieldCIDRV6URLs = "IPv6 CIDR URL Sources"
|
||||
FieldMTUOverride = "MTU Override"
|
||||
|
||||
PlaceholderCIDRs = "10.0.0.0/8, 172.16.0.0/12"
|
||||
PlaceholderCIDRV4 = "10.0.0.0/8, 172.16.0.0/12"
|
||||
PlaceholderCIDRV6 = "fd00::/8, 2001:db8::/32"
|
||||
PlaceholderCIDRURL = "https://example.com/cidrs.txt"
|
||||
PlaceholderMTU = "0 = use server MTU"
|
||||
PlaceholderPasswordUnchanged = "(unchanged)"
|
||||
PlaceholderServerIPs = "IPv4/IPv6 supported, e.g. 1.2.3.4, 5.6.7.8"
|
||||
@@ -101,8 +112,14 @@ AuthModeJWT = "JWT"
|
||||
AuthModePassword = "Password"
|
||||
|
||||
RoutingModeFull = "Full Tunnel"
|
||||
RoutingModeSplit = "Split Tunnel"
|
||||
RoutingModeCustom = "Custom"
|
||||
RoutingModeProxy = "Proxy CIDR"
|
||||
RoutingModeBypass = "Bypass CIDR"
|
||||
|
||||
FetchTimingBefore = "Before Proxy"
|
||||
FetchTimingAfter = "After Proxy"
|
||||
|
||||
BtnAddURL = "Add URL"
|
||||
BtnRemoveURL = "Remove"
|
||||
|
||||
FieldTLS = "TLS Certificate"
|
||||
FieldTLSCACert = "CA Certificate (PEM)"
|
||||
|
||||
Reference in New Issue
Block a user