chore: support set cwnd for hy2 too

This commit is contained in:
wwqgtxx
2023-09-21 16:41:31 +08:00
parent ee3213c28f
commit da24810da2
7 changed files with 13 additions and 5 deletions

View File

@ -16,6 +16,7 @@ type Hysteria2Server struct {
Down string `yaml:"down" json:"down,omitempty"`
IgnoreClientBandwidth bool `yaml:"ignore-client-bandwidth" json:"ignore-client-bandwidth,omitempty"`
Masquerade string `yaml:"masquerade" json:"masquerade,omitempty"`
CWND int `yaml:"cwnd" json:"cwnd,omitempty"`
}
func (h Hysteria2Server) String() string {

View File

@ -20,6 +20,7 @@ type Hysteria2Option struct {
Down string `inbound:"down,omitempty"`
IgnoreClientBandwidth bool `inbound:"ignore-client-bandwidth,omitempty"`
Masquerade string `inbound:"masquerade,omitempty"`
CWND int `inbound:"cwnd,omitempty"`
}
func (o Hysteria2Option) Equal(config C.InboundConfig) bool {
@ -55,6 +56,7 @@ func NewHysteria2(options *Hysteria2Option) (*Hysteria2, error) {
Down: options.Down,
IgnoreClientBandwidth: options.IgnoreClientBandwidth,
Masquerade: options.Masquerade,
CWND: options.CWND,
},
}, nil
}

View File

@ -111,6 +111,7 @@ func New(config LC.Hysteria2Server, tcpIn chan<- C.ConnContext, udpIn chan<- C.P
IgnoreClientBandwidth: config.IgnoreClientBandwidth,
Handler: h,
MasqueradeHandler: masqueradeHandler,
CWND: config.CWND,
})
if err != nil {
return nil, err