update bandwidth_limit

This commit is contained in:
fatedier
2019-11-09 01:13:30 +08:00
parent 2ab832bb89
commit 12cc53d699
4 changed files with 74 additions and 22 deletions

View File

@ -54,7 +54,7 @@ type Proxy interface {
func NewProxy(ctx context.Context, pxyConf config.ProxyConf, clientCfg config.ClientCommonConf, serverUDPPort int) (pxy Proxy) {
var limiter *rate.Limiter
limitBytes := pxyConf.GetBaseInfo().BandwithLimit.Bytes()
limitBytes := pxyConf.GetBaseInfo().BandwidthLimit.Bytes()
if limitBytes > 0 {
limiter = rate.NewLimiter(rate.Limit(float64(limitBytes)), int(limitBytes))
}