func SettingDecodeJSON(dir string) (*Setting, error) {
	pa := &Setting{
		SystemProxy: &SystemProxy{
			HTTP:   true,
			Socks5: false,
		},
		Bypass: &Bypass{
			Enabled:    true,
			BypassFile: path.Join(dir, "yuhaiin.conf"),
		},
		Proxy: &Proxy{
			HTTP:   "127.0.0.1:8188",
			Socks5: "127.0.0.1:1080",
			Redir:  "127.0.0.1:8088",
		},
		Dns: &DnsSetting{
			Remote: &DNS{
				Host:   "cloudflare-dns.com",
				Type:   DNS_doh,
				Proxy:  false,
				Subnet: "0.0.0.0/32",
			},
			Local: &DNS{
				Host: "223.5.5.5",
				Type: DNS_doh,
			},
		},
	}
	data, err := ioutil.ReadFile(filepath.Join(dir, "yuhaiinConfig.json"))
	if err != nil {
		if os.IsNotExist(err) {
			return pa, SettingEnCodeJSON(pa, dir)
		}
		return pa, fmt.Errorf("read config file failed: %v", err)
	}
	err = protojson.UnmarshalOptions{DiscardUnknown: true}.Unmarshal(data, pa)
	return pa, err
}
SettingDecodeJSON decode setting json to struct
package config
import (
	context "context"
	"fmt"
	"io/ioutil"
	"os"
	"path"
	"path/filepath"
	"sync"
	"google.golang.org/protobuf/encoding/protojson"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)