From 46e2e3af61a215f285afaaf457dae8cc20b6a303 Mon Sep 17 00:00:00 2001 From: Zongxin Gan Date: Sun, 18 Feb 2024 18:25:57 +0800 Subject: [PATCH] fix vless reality parsing --- model/proxy_vmess.go | 4 ++-- parser/vless.go | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/model/proxy_vmess.go b/model/proxy_vmess.go index f70d41f..1d1b2ab 100644 --- a/model/proxy_vmess.go +++ b/model/proxy_vmess.go @@ -16,8 +16,8 @@ type GrpcOptions struct { } type RealityOptions struct { - PublicKey string `proxy:"public-key"` - ShortID string `proxy:"short-id"` + PublicKey string `yaml:"public-key"` + ShortID string `yaml:"short-id,omitempty"` } type WSOptions struct { diff --git a/parser/vless.go b/parser/vless.go index 1a0c326..ff54a7a 100644 --- a/parser/vless.go +++ b/parser/vless.go @@ -36,17 +36,17 @@ func ParseVless(proxy string) (model.Proxy, error) { } // θΏ”ε›žη»“ζžœ result := model.Proxy{ - Type: "vless", - Server: strings.TrimSpace(serverAndPort[0]), - Port: port, - UUID: strings.TrimSpace(parts[0]), - UDP: true, - Sni: params.Get("sni"), - Network: params.Get("type"), - TLS: params.Get("security") == "tls", - Flow: params.Get("flow"), - Fingerprint: params.Get("fp"), - Servername: params.Get("sni"), + Type: "vless", + Server: strings.TrimSpace(serverAndPort[0]), + Port: port, + UUID: strings.TrimSpace(parts[0]), + UDP: true, + Sni: params.Get("sni"), + Network: params.Get("type"), + TLS: params.Get("security") == "reality", + Flow: params.Get("flow"), + ClientFingerprint: params.Get("fp"), + Servername: params.Get("sni"), RealityOpts: model.RealityOptions{ PublicKey: params.Get("pbk"), },