mirror of
https://github.com/v2rayA/v2rayA.git
synced 2024-11-25 16:34:19 +08:00
feat(vmess): fuzzily parse allowInsecure
This commit is contained in:
parent
b0a7e6b2c3
commit
d35f5d99e0
@ -4,6 +4,8 @@ import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/tidwall/gjson"
|
||||
"github.com/tidwall/sjson"
|
||||
"github.com/v2rayA/v2rayA/common"
|
||||
"github.com/v2rayA/v2rayA/common/ntp"
|
||||
"github.com/v2rayA/v2rayA/core/coreObj"
|
||||
@ -165,6 +167,12 @@ func ParseVmessURL(vmess string) (data *V2Ray, err error) {
|
||||
info.Net = "ws"
|
||||
}
|
||||
} else {
|
||||
// fuzzily parse allowInsecure
|
||||
if allowInsecure := gjson.Get(raw, "allowInsecure"); allowInsecure.Exists() {
|
||||
if newRaw, err := sjson.Set(raw, "allowInsecure", allowInsecure.Bool()); err == nil {
|
||||
raw = newRaw
|
||||
}
|
||||
}
|
||||
err = jsoniter.Unmarshal([]byte(raw), &info)
|
||||
if err != nil {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user