From 30cb888fa7216581472a706cf5ef852b1086974a Mon Sep 17 00:00:00 2001 From: Hiddify <114227601+hiddify1@users.noreply.github.com> Date: Sat, 9 Sep 2023 14:57:56 +0000 Subject: [PATCH] fix: bug in v2ray to clash --- shared/parser.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/shared/parser.go b/shared/parser.go index 48c1d3c2..329ea000 100644 --- a/shared/parser.go +++ b/shared/parser.go @@ -40,18 +40,13 @@ func ParseConfig(path string) error { return nil } func parseV2rayFormat(content []byte) ([]byte, error) { - clash_conf, err := converter.ParseConfig(string(content), "full") + clash_conf, err := converter.GenerateProxies(string(content), "meta") if err != nil { fmt.Printf("error: %v\n", err) return nil, err } - clash_conf_yaml, err := yaml.Marshal(clash_conf) - if err != nil { - fmt.Printf("error: %v\n", err) - return nil, err - } - fmt.Printf("clash_conf: %s\n", clash_conf_yaml) // Print YAML as string - return clash_conf_yaml, nil + fmt.Printf("v2ray to clash: %v\n", clash_conf) + return []byte(clash_conf), nil } func parseClash(content []byte) ([]byte, error) { clashConfig := clash.Clash{}