From 86885f6b47e7a76bc0b0b68d020375c3384db9ce Mon Sep 17 00:00:00 2001 From: nite07 Date: Wed, 20 Mar 2024 20:58:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20vmess/vless=20quic=20=E7=BC=BA=E5=B0=91?= =?UTF-8?q?=20tls=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parser/vless.go | 3 +++ parser/vmess.go | 18 ++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/parser/vless.go b/parser/vless.go index 4ac80b5..9005cf5 100644 --- a/parser/vless.go +++ b/parser/vless.go @@ -109,6 +109,9 @@ func ParseVless(proxy string) (model2.Proxy, error) { Type: "quic", QUICOptions: model2.V2RayQUICOptions{}, } + result.VLESS.TLS = &model2.OutboundTLSOptions{ + Enabled: true, + } } if params.Get("type") == "grpc" { result.VLESS.Transport = &model2.V2RayTransportOptions{ diff --git a/parser/vmess.go b/parser/vmess.go index 051db02..3288118 100644 --- a/parser/vmess.go +++ b/parser/vmess.go @@ -71,14 +71,13 @@ func ParseVmess(proxy string) (model2.Proxy, error) { } else { alpn = nil } - tls := model2.OutboundTLSOptions{ + result.VMess.TLS = &model2.OutboundTLSOptions{ Enabled: true, UTLS: &model2.OutboundUTLSOptions{ Fingerprint: vmess.Fp, }, ALPN: alpn, } - result.VMess.TLS = &tls } if vmess.Net == "ws" { @@ -94,20 +93,21 @@ func ParseVmess(proxy string) (model2.Proxy, error) { "Host": vmess.Host, }, } - transport := model2.V2RayTransportOptions{ + result.VMess.Transport = &model2.V2RayTransportOptions{ Type: "ws", WebsocketOptions: ws, } - result.VMess.Transport = &transport } if vmess.Net == "quic" { quic := model2.V2RayQUICOptions{} - transport := model2.V2RayTransportOptions{ + result.VMess.Transport = &model2.V2RayTransportOptions{ Type: "quic", QUICOptions: quic, } - result.VMess.Transport = &transport + result.VMess.TLS = &model2.OutboundTLSOptions{ + Enabled: true, + } } if vmess.Net == "grpc" { @@ -115,11 +115,10 @@ func ParseVmess(proxy string) (model2.Proxy, error) { ServiceName: vmess.Path, PermitWithoutStream: true, } - transport := model2.V2RayTransportOptions{ + result.VMess.Transport = &model2.V2RayTransportOptions{ Type: "grpc", GRPCOptions: grpc, } - result.VMess.Transport = &transport } if vmess.Net == "h2" { @@ -127,11 +126,10 @@ func ParseVmess(proxy string) (model2.Proxy, error) { Host: strings.Split(vmess.Host, ","), Path: vmess.Path, } - transport := model2.V2RayTransportOptions{ + result.VMess.Transport = &model2.V2RayTransportOptions{ Type: "http", HTTPOptions: httpOps, } - result.VMess.Transport = &transport } return result, nil