limit: clamp bandwidth limiter burst (#5471)

This commit is contained in:
fatedier
2026-08-09 17:30:39 +08:00
committed by GitHub
parent 5b68148f11
commit f666d97b64
6 changed files with 117 additions and 2 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ func NewProxy(
var limiter *rate.Limiter
limitBytes := pxyConf.GetBaseConfig().Transport.BandwidthLimit.Bytes()
if limitBytes > 0 && pxyConf.GetBaseConfig().Transport.BandwidthLimitMode == types.BandwidthLimitModeClient {
limiter = rate.NewLimiter(rate.Limit(float64(limitBytes)), int(limitBytes))
limiter = limit.NewBandwidthLimiter(limitBytes)
}
baseProxy := BaseProxy{