Skip to content

Commit 2220b06

Browse files
committed
fix(protocol): 修复TUIC协议参数名称和调试信息
- 修复查询参数名称从 allow_insecure 改为 insecure - 修正调试输出中拥塞控制字段的标签名称 - 添加 insecure 参数的调试信息输出 - 更新生成URL时使用的参数名称保持一致性
1 parent eea4978 commit 2220b06

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

node/protocol/tuic.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ func DecodeTuicURL(s string) (Tuic, error) {
6464
tls := security == "tls" || security == ""
6565
// 解析fp参数,获取客户端指纹
6666
clientFingerprint := u.Query().Get("fp")
67-
// 解析 allow_insecure 参数,跳过证书验证
68-
insecure, _ := strconv.Atoi(u.Query().Get("allow_insecure"))
67+
// 解析 insecure 参数,跳过证书验证
68+
insecure, _ := strconv.Atoi(u.Query().Get("insecure"))
6969
name := u.Fragment
7070
// 如果没有设置 Name,则使用 Host:Port 作为 Fragment
7171
if name == "" {
@@ -81,7 +81,8 @@ func DecodeTuicURL(s string) (Tuic, error) {
8181
fmt.Println("password:", password)
8282
fmt.Println("server:", server)
8383
fmt.Println("port:", port)
84-
fmt.Println("insecure:", Congestioncontrol)
84+
fmt.Println("congestion_control:", Congestioncontrol)
85+
fmt.Println("insecure:", insecure)
8586
fmt.Println("uuid:", uuid)
8687
fmt.Println("udprelay_mode:", Udprelay_mode)
8788
fmt.Println("alpn:", alpn)
@@ -157,7 +158,7 @@ func EncodeTuicURL(t Tuic) string {
157158
q.Set("token", t.Token)
158159
}
159160
if t.Insecure != 0 {
160-
q.Set("allow_insecure", strconv.Itoa(t.Insecure))
161+
q.Set("insecure", strconv.Itoa(t.Insecure))
161162
}
162163

163164
u.RawQuery = q.Encode()

0 commit comments

Comments
 (0)