github.com/metacubex/mihomo@v1.18.5/listener/config/hysteria2.go (about) 1 package config 2 3 import ( 4 "github.com/metacubex/mihomo/listener/sing" 5 6 "encoding/json" 7 ) 8 9 type Hysteria2Server struct { 10 Enable bool `yaml:"enable" json:"enable"` 11 Listen string `yaml:"listen" json:"listen"` 12 Users map[string]string `yaml:"users" json:"users,omitempty"` 13 Obfs string `yaml:"obfs" json:"obfs,omitempty"` 14 ObfsPassword string `yaml:"obfs-password" json:"obfs-password,omitempty"` 15 Certificate string `yaml:"certificate" json:"certificate"` 16 PrivateKey string `yaml:"private-key" json:"private-key"` 17 MaxIdleTime int `yaml:"max-idle-time" json:"max-idle-time,omitempty"` 18 ALPN []string `yaml:"alpn" json:"alpn,omitempty"` 19 Up string `yaml:"up" json:"up,omitempty"` 20 Down string `yaml:"down" json:"down,omitempty"` 21 IgnoreClientBandwidth bool `yaml:"ignore-client-bandwidth" json:"ignore-client-bandwidth,omitempty"` 22 Masquerade string `yaml:"masquerade" json:"masquerade,omitempty"` 23 CWND int `yaml:"cwnd" json:"cwnd,omitempty"` 24 UdpMTU int `yaml:"udp-mtu" json:"udp-mtu,omitempty"` 25 MuxOption sing.MuxOption `yaml:"mux-option" json:"mux-option,omitempty"` 26 } 27 28 func (h Hysteria2Server) String() string { 29 b, _ := json.Marshal(h) 30 return string(b) 31 }