From e11587768b17c65e1b6e4e897104c6275534b3f5 Mon Sep 17 00:00:00 2001 From: snakem982 Date: Sat, 13 Jan 2024 19:43:02 +0800 Subject: [PATCH] feat: support hy2 schema parsing --- common/convert/converter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/convert/converter.go b/common/convert/converter.go index ee15446c..809aa94f 100644 --- a/common/convert/converter.go +++ b/common/convert/converter.go @@ -80,7 +80,7 @@ func ConvertsV2Ray(buf []byte) ([]map[string]any, error) { hysteria2 := make(map[string]any, 20) hysteria2["name"] = name - hysteria2["type"] = scheme + hysteria2["type"] = "hysteria2" hysteria2["server"] = urlHysteria2.Hostname() if port := urlHysteria2.Port(); port != "" { hysteria2["port"] = port @@ -409,7 +409,7 @@ func ConvertsV2Ray(buf []byte) ([]map[string]any, error) { } plugin := query.Get("plugin") if strings.Contains(plugin, ";") { - pluginInfo, _ := url.ParseQuery("pluginName=" + strings.ReplaceAll(plugin, ";", "&")) + pluginInfo, _ := url.ParseQuery("pluginName=" + strings.ReplaceAll(plugin, ";", "&")) pluginName := pluginInfo.Get("pluginName") if strings.Contains(pluginName, "obfs") { ss["plugin"] = "obfs"