fix: bug in v2ray to clash

This commit is contained in:
Hiddify
2023-09-09 14:57:56 +00:00
parent ab87976b2a
commit 30cb888fa7

View File

@@ -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{}