mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
fix: tuic server cwnd parsing
This commit is contained in:
parent
6d824c8745
commit
919daf0dbb
|
@ -230,6 +230,7 @@ type RawTuicServer struct {
|
|||
AuthenticationTimeout int `yaml:"authentication-timeout" json:"authentication-timeout,omitempty"`
|
||||
ALPN []string `yaml:"alpn" json:"alpn,omitempty"`
|
||||
MaxUdpRelayPacketSize int `yaml:"max-udp-relay-packet-size" json:"max-udp-relay-packet-size,omitempty"`
|
||||
CWND int `yaml:"cwnd" json:"cwnd,omitempty"`
|
||||
}
|
||||
|
||||
type RawConfig struct {
|
||||
|
@ -1304,6 +1305,7 @@ func parseTuicServer(rawTuic RawTuicServer, general *General) error {
|
|||
AuthenticationTimeout: rawTuic.AuthenticationTimeout,
|
||||
ALPN: rawTuic.ALPN,
|
||||
MaxUdpRelayPacketSize: rawTuic.MaxUdpRelayPacketSize,
|
||||
CWND: rawTuic.CWND,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ type tuicServerSchema struct {
|
|||
AuthenticationTimeout *int `yaml:"authentication-timeout" json:"authentication-timeout,omitempty"`
|
||||
ALPN *[]string `yaml:"alpn" json:"alpn,omitempty"`
|
||||
MaxUdpRelayPacketSize *int `yaml:"max-udp-relay-packet-size" json:"max-udp-relay-packet-size,omitempty"`
|
||||
CWND *int `yaml:"cwnd" json:"cwnd,omitempty"`
|
||||
}
|
||||
|
||||
func getConfigs(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -211,6 +212,9 @@ func pointerOrDefaultTuicServer(p *tuicServerSchema, def LC.TuicServer) LC.TuicS
|
|||
if p.MaxUdpRelayPacketSize != nil {
|
||||
def.MaxUdpRelayPacketSize = *p.MaxUdpRelayPacketSize
|
||||
}
|
||||
if p.CWND != nil {
|
||||
def.CWND = *p.CWND
|
||||
}
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ type TuicOption struct {
|
|||
AuthenticationTimeout int `inbound:"authentication-timeout,omitempty"`
|
||||
ALPN []string `inbound:"alpn,omitempty"`
|
||||
MaxUdpRelayPacketSize int `inbound:"max-udp-relay-packet-size,omitempty"`
|
||||
CWND int `inbound:"cwnd,omitempty"`
|
||||
}
|
||||
|
||||
func (o TuicOption) Equal(config C.InboundConfig) bool {
|
||||
|
@ -51,6 +52,7 @@ func NewTuic(options *TuicOption) (*Tuic, error) {
|
|||
AuthenticationTimeout: options.AuthenticationTimeout,
|
||||
ALPN: options.ALPN,
|
||||
MaxUdpRelayPacketSize: options.MaxUdpRelayPacketSize,
|
||||
CWND: options.CWND,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user