From 867e3acfde3025d66f826c41932a8993aa5f85d0 Mon Sep 17 00:00:00 2001 From: Hiddify <114227601+hiddify-com@users.noreply.github.com> Date: Tue, 16 Jan 2024 17:16:13 +0000 Subject: [PATCH] force json as singbox config --- config/parser.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/parser.go b/config/parser.go index c80ce1d..160d168 100644 --- a/config/parser.go +++ b/config/parser.go @@ -4,10 +4,10 @@ import ( _ "embed" "fmt" "os" + "encoding/json" "github.com/hiddify/ray2sing/ray2sing" "github.com/sagernet/sing-box/experimental/libbox" - "github.com/sagernet/sing-box/option" "github.com/xmdhs/clash2singbox/convert" "github.com/xmdhs/clash2singbox/model/clash" "gopkg.in/yaml.v3" @@ -74,10 +74,10 @@ func parseClashConfig(content []byte, debug bool) ([]byte, error) { } func parseSingboxConfig(content []byte, debug bool) ([]byte, error) { - var options option.Options - err := options.UnmarshalJSON(content) - if err != nil { - fmt.Printf("[SingboxParser] unmarshal error: %s\n", err) + + var dummy interface{} + err := json.Unmarshal(content, &dummy) + if err != nil{ return nil, err } return content, nil