2,190
社区成员
发帖
与我相关
我的任务
分享
{
"inbounds": [
{
"port": 1080,
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"settings": {
"auth": "noauth"
}
}
]
}
package main
import (
"fmt"
"io/ioutil"
"encoding/json"
)
type Set struct {
Auth string `json:"auth"`
}
type Snif struct {
Enabled bool `json:"enabled"`
DestOverride []string `json:"destOverride"`
}
type In struct {
Port float64 `json:"port"`
Protocol string `json:"protocol"`
Sniffing Snif `json:"sniffing"`
Settings Set `json:"settings"`
}
type Fuck struct {
Inbounds In `json:"inbounds"`
}
func main() {
var sex Fuck
data,_ := ioutil.ReadFile("vmess_client.json")
json.Unmarshal(data,&sex)
fmt.Println(sex)
}
这样写json很头痛,换一个gjson 库