From 930a7af8e785dfc904f3a054b484eb91ad16206f Mon Sep 17 00:00:00 2001 From: MetaCubeX Date: Wed, 15 Jun 2022 23:18:06 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20hy=20URI=20Scheme=20=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/convert/converter.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/common/convert/converter.go b/common/convert/converter.go index 662a827e..710d8358 100644 --- a/common/convert/converter.go +++ b/common/convert/converter.go @@ -66,8 +66,16 @@ func ConvertsV2Ray(buf []byte) ([]map[string]any, error) { hysteria["alpn"] = query.Get("alpn") hysteria["auth_str"] = query.Get("auth") hysteria["protocol"] = query.Get("protocol") - hysteria["down_mbps"], _ = strconv.Atoi(query.Get("downmbps")) - hysteria["up_mbps"], _ = strconv.Atoi(query.Get("upmbps")) + up := query.Get("up") + down := query.Get("down") + if up == "" { + up = query.Get("upmbps") + } + if down == "" { + down = query.Get("downmbps") + } + hysteria["down"] = down + hysteria["up"] = up hysteria["skip-cert-verify"], _ = strconv.ParseBool(query.Get("insecure")) proxies = append(proxies, hysteria)