diff --git a/common/convert/converter.go b/common/convert/converter.go index 33d20cc8..851920a6 100644 --- a/common/convert/converter.go +++ b/common/convert/converter.go @@ -144,14 +144,6 @@ func ConvertsV2Ray(buf []byte) ([]map[string]any, error) { if encryption := query.Get("encryption"); encryption != "" { vmess["cipher"] = encryption } - if packetEncoding := query.Get("packetEncoding"); packetEncoding != "" { - switch packetEncoding { - case "packet": - vmess["packet-addr"] = true - case "xudp": - vmess["xudp"] = true - } - } proxies = append(proxies, vmess) continue } diff --git a/common/convert/v.go b/common/convert/v.go index 53e28ff2..29be4a9f 100644 --- a/common/convert/v.go +++ b/common/convert/v.go @@ -15,7 +15,6 @@ func handleVShareLink(names map[string]int, url *url.URL, scheme string, proxy m proxy["port"] = url.Port() proxy["uuid"] = url.User.Username() proxy["udp"] = true - proxy["xudp"] = true proxy["skip-cert-verify"] = false proxy["tls"] = false tls := strings.ToLower(query.Get("security")) @@ -26,6 +25,14 @@ func handleVShareLink(names map[string]int, url *url.URL, scheme string, proxy m proxy["servername"] = sni } + switch query.Get("packetEncoding") { + case "none": + case "packet": + proxy["packet-addr"] = true + default: + proxy["xudp"] = true + } + network := strings.ToLower(query.Get("type")) if network == "" { network = "tcp"