fix: CDN优选IP支持IPv6、格式校验及错误降级
- replaceHost() 自动为裸 IPv6 地址包裹方括号,修复 IPv6 URL 畸形问题 - 新增 ValidateServerIPs() 校验 IP 格式,保存配置时拦截非法输入 - GetServerIPList() 运行时自动过滤非法 IP 条目 - CDN IP 尝试时 TLS/认证错误降级为非致命,跳过该 IP 继续故障转移 而非终止整个连接循环(仅原始域名 ipIndex==0 时才判为致命) - 占位符提示支持 IPv4/IPv6
This commit is contained in:
@@ -3,6 +3,7 @@ package ui
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"lmvpn/internal/i18n"
|
||||
"lmvpn/internal/model"
|
||||
@@ -270,6 +271,17 @@ func (a *App) saveProfile(editing *model.ServerProfile,
|
||||
return false
|
||||
}
|
||||
|
||||
if ips != "" {
|
||||
tmp := &model.ServerProfile{ServerIPs: ips}
|
||||
_, invalid := tmp.ValidateServerIPs()
|
||||
if len(invalid) > 0 {
|
||||
showError(i18n.T("DlgValidationTitle"),
|
||||
fmt.Sprintf(i18n.T("DlgInvalidIPMsg"), strings.Join(invalid, ", ")),
|
||||
a.window)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
port := parseIntDefault(portStr, 443)
|
||||
mtu := parseIntDefault(mtuStr, 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user