mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-07-29 05:34:32 +00:00
feat: built-in speed test client & server
This commit is contained in:
@@ -52,6 +52,7 @@ type serverConfig struct {
|
||||
QUIC serverConfigQUIC `mapstructure:"quic"`
|
||||
Bandwidth serverConfigBandwidth `mapstructure:"bandwidth"`
|
||||
IgnoreClientBandwidth bool `mapstructure:"ignoreClientBandwidth"`
|
||||
SpeedTest bool `mapstructure:"speedTest"`
|
||||
DisableUDP bool `mapstructure:"disableUDP"`
|
||||
UDPIdleTimeout time.Duration `mapstructure:"udpIdleTimeout"`
|
||||
Auth serverConfigAuth `mapstructure:"auth"`
|
||||
@@ -528,6 +529,11 @@ func (c *serverConfig) fillOutboundConfig(hyConfig *server.Config) error {
|
||||
return configError{Field: "resolver.type", Err: errors.New("unsupported resolver type")}
|
||||
}
|
||||
|
||||
// Speed test
|
||||
if c.SpeedTest {
|
||||
uOb = outbounds.NewSpeedtestHandler(uOb)
|
||||
}
|
||||
|
||||
hyConfig.Outbound = &outbounds.PluggableOutboundAdapter{PluggableOutbound: uOb}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user