mirror of
https://github.com/fatedier/frp.git
synced 2026-08-31 01:35:58 +08:00
limit: clamp bandwidth limiter burst (#5471)
This commit is contained in:
@@ -536,7 +536,7 @@ func NewProxy(ctx context.Context, options *Options) (pxy Proxy, err error) {
|
||||
var limiter *rate.Limiter
|
||||
limitBytes := configurer.GetBaseConfig().Transport.BandwidthLimit.Bytes()
|
||||
if limitBytes > 0 && configurer.GetBaseConfig().Transport.BandwidthLimitMode == types.BandwidthLimitModeServer {
|
||||
limiter = rate.NewLimiter(rate.Limit(float64(limitBytes)), int(limitBytes))
|
||||
limiter = limit.NewBandwidthLimiter(limitBytes)
|
||||
}
|
||||
|
||||
basePxy := BaseProxy{
|
||||
|
||||
Reference in New Issue
Block a user