1
0
mirror of https://github.com/nitezs/sub2clash.git synced 2024-12-23 21:34:41 -05:00
This commit is contained in:
Nite07 2024-05-21 15:28:09 +08:00
parent 98bca0a7ac
commit 0946412ea7

View File

@ -59,8 +59,28 @@ type Proxy struct {
Ports string `yaml:"ports,omitempty"` Ports string `yaml:"ports,omitempty"`
AuthStringOLD string `yaml:"auth_str,omitempty"` AuthStringOLD string `yaml:"auth_str,omitempty"`
AuthString string `yaml:"auth-str,omitempty"` AuthString string `yaml:"auth-str,omitempty"`
Ip string `yaml:"ip,omitempty"`
Ipv6 string `yaml:"ipv6,omitempty"`
PrivateKey string `yaml:"private-key,omitempty"`
Workers int `yaml:"workers,omitempty"`
MTU int `yaml:"mtu,omitempty"`
PersistentKeepalive int `yaml:"persistent-keepalive,omitempty"`
Peers []WireGuardPeerOption `yaml:"peers,omitempty"`
RemoteDnsResolve bool `yaml:"remote-dns-resolve,omitempty"`
Dns []string `yaml:"dns,omitempty"`
} }
type WireGuardPeerOption struct {
Server string `yaml:"server"`
Port int `yaml:"port"`
PublicKey string `yaml:"public-key,omitempty"`
PreSharedKey string `yaml:"pre-shared-key,omitempty"`
Reserved []uint8 `yaml:"reserved,omitempty"`
AllowedIPs []string `yaml:"allowed-ips,omitempty"`
}
type _Proxy Proxy
func (p Proxy) MarshalYAML() (interface{}, error) { func (p Proxy) MarshalYAML() (interface{}, error) {
switch p.Type { switch p.Type {
case "vmess": case "vmess":
@ -77,6 +97,7 @@ func (p Proxy) MarshalYAML() (interface{}, error) {
return ProxyToHysteria(p), nil return ProxyToHysteria(p), nil
case "hysteria2": case "hysteria2":
return ProxyToHysteria2(p), nil return ProxyToHysteria2(p), nil
default:
return _Proxy(p), nil
} }
return nil, nil
} }