diff --git a/infra/conf/v5cfg/init.go b/infra/conf/v5cfg/init.go index db2d5cacf..a357c86ad 100644 --- a/infra/conf/v5cfg/init.go +++ b/infra/conf/v5cfg/init.go @@ -1,6 +1,7 @@ package v5cfg import ( + "bytes" "io" core "github.com/v2fly/v2ray-core/v5" @@ -30,6 +31,15 @@ func init() { return nil, err } return loadJSONConfig(data) + case []byte: + r := &json.Reader{ + Reader: bytes.NewReader(v), + } + data, err := buf.ReadAllToBytes(r) + if err != nil { + return nil, err + } + return loadJSONConfig(data) case io.Reader: data, err := buf.ReadAllToBytes(&json.Reader{ Reader: v,