Skip to content

Commit

Permalink
force json as singbox config
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Jan 16, 2024
1 parent e6fe03c commit 867e3ac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions config/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 867e3ac

Please sign in to comment.