mirror of
https://github.com/bestnite/sub2sing-box.git
synced 2025-06-16 10:03:18 +08:00
update
This commit is contained in:
@ -91,7 +91,7 @@ type DNSRule struct {
|
||||
Type string `json:"type,omitempty"`
|
||||
Inbound Listable[string] `json:"inbound,omitempty"`
|
||||
IPVersion int `json:"ip_version,omitempty"`
|
||||
QueryType Listable[uint16] `json:"query_type,omitempty"`
|
||||
QueryType Listable[string] `json:"query_type,omitempty"`
|
||||
Network Listable[string] `json:"network,omitempty"`
|
||||
AuthUser Listable[string] `json:"auth_user,omitempty"`
|
||||
Protocol Listable[string] `json:"protocol,omitempty"`
|
||||
@ -126,7 +126,7 @@ type DNSRule struct {
|
||||
DisableCache bool `json:"disable_cache,omitempty"`
|
||||
RewriteTTL uint32 `json:"rewrite_ttl,omitempty"`
|
||||
ClientSubnet string `json:"client_subnet,omitempty"`
|
||||
Mode string `json:"mode"`
|
||||
Mode string `json:"mode,omitempty"`
|
||||
Rules Listable[DNSRule] `json:"rules,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
package model
|
||||
|
||||
type Hysteria struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Server string `json:"server"`
|
||||
ServerPort uint16 `json:"server_port"`
|
||||
Up string `json:"up,omitempty"`
|
||||
|
@ -6,8 +6,6 @@ type Hysteria2Obfs struct {
|
||||
}
|
||||
|
||||
type Hysteria2 struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Server string `json:"server"`
|
||||
ServerPort uint16 `json:"server_port"`
|
||||
UpMbps int `json:"up_mbps,omitempty"`
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
|
||||
type Proxy struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Shadowsocks `json:"-"`
|
||||
VMess `json:"-"`
|
||||
VLESS `json:"-"`
|
||||
@ -20,57 +21,71 @@ func (p *Proxy) MarshalJSON() ([]byte, error) {
|
||||
case "shadowsocks":
|
||||
return json.Marshal(&struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Shadowsocks
|
||||
}{
|
||||
Type: p.Type,
|
||||
Tag: p.Tag,
|
||||
Shadowsocks: p.Shadowsocks,
|
||||
})
|
||||
case "vmess":
|
||||
return json.Marshal(&struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
VMess
|
||||
}{
|
||||
Type: p.Type,
|
||||
Tag: p.Tag,
|
||||
VMess: p.VMess,
|
||||
})
|
||||
case "vless":
|
||||
return json.Marshal(&struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
VLESS
|
||||
}{
|
||||
Type: p.Type,
|
||||
Tag: p.Tag,
|
||||
VLESS: p.VLESS,
|
||||
})
|
||||
case "trojan":
|
||||
return json.Marshal(&struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Trojan
|
||||
}{
|
||||
Type: p.Type,
|
||||
Tag: p.Tag,
|
||||
Trojan: p.Trojan,
|
||||
})
|
||||
case "tuic":
|
||||
return json.Marshal(&struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
TUIC
|
||||
}{
|
||||
Type: p.Type,
|
||||
Tag: p.Tag,
|
||||
TUIC: p.TUIC,
|
||||
})
|
||||
case "hysteria":
|
||||
return json.Marshal(&struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Hysteria
|
||||
}{
|
||||
Type: p.Type,
|
||||
Tag: p.Tag,
|
||||
Hysteria: p.Hysteria,
|
||||
})
|
||||
case "hysteria2":
|
||||
return json.Marshal(&struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Hysteria2
|
||||
}{
|
||||
Type: p.Type,
|
||||
Tag: p.Tag,
|
||||
Hysteria2: p.Hysteria2,
|
||||
})
|
||||
default:
|
||||
|
@ -1,7 +1,6 @@
|
||||
package model
|
||||
|
||||
type Shadowsocks struct {
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Server string `json:"server"`
|
||||
ServerPort uint16 `json:"server_port"`
|
||||
Method string `json:"method"`
|
||||
|
@ -1,8 +1,6 @@
|
||||
package model
|
||||
|
||||
type Trojan struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Server string `json:"server"`
|
||||
ServerPort uint16 `json:"server_port"`
|
||||
Password string `json:"password"`
|
||||
|
@ -1,8 +1,6 @@
|
||||
package model
|
||||
|
||||
type TUIC struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Server string `json:"server"`
|
||||
ServerPort uint16 `json:"server_port"`
|
||||
UUID string `json:"uuid,omitempty"`
|
||||
|
@ -1,8 +1,6 @@
|
||||
package model
|
||||
|
||||
type VLESS struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Server string `json:"server"`
|
||||
ServerPort uint16 `json:"server_port"`
|
||||
UUID string `json:"uuid"`
|
||||
|
@ -19,8 +19,6 @@ type VmessJson struct {
|
||||
}
|
||||
|
||||
type VMess struct {
|
||||
Type string `json:"type"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Server string `json:"server"`
|
||||
ServerPort uint16 `json:"server_port"`
|
||||
UUID string `json:"uuid"`
|
||||
|
Reference in New Issue
Block a user