Skip to content

Commit

Permalink
fix: bug in v2ray to clash
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Sep 9, 2023
1 parent ab87976 commit 30cb888
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions shared/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down

0 comments on commit 30cb888

Please sign in to comment.