File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -396,7 +396,10 @@ func (cfg *BaseProxyConf) marshalToMsg(pMsg *msg.NewProxy) {
396396 pMsg .UseEncryption = cfg .UseEncryption
397397 pMsg .UseCompression = cfg .UseCompression
398398 pMsg .BandwidthLimit = cfg .BandwidthLimit .String ()
399- pMsg .BandwidthLimitMode = cfg .BandwidthLimitMode
399+ // leave it empty for default value to reduce traffic
400+ if cfg .BandwidthLimitMode != "client" {
401+ pMsg .BandwidthLimitMode = cfg .BandwidthLimitMode
402+ }
400403 pMsg .Group = cfg .Group
401404 pMsg .GroupKey = cfg .GroupKey
402405 pMsg .Metas = cfg .Metas
@@ -407,8 +410,12 @@ func (cfg *BaseProxyConf) unmarshalFromMsg(pMsg *msg.NewProxy) {
407410 cfg .ProxyType = pMsg .ProxyType
408411 cfg .UseEncryption = pMsg .UseEncryption
409412 cfg .UseCompression = pMsg .UseCompression
410- cfg .BandwidthLimit , _ = NewBandwidthQuantity (pMsg .BandwidthLimit )
411- cfg .BandwidthLimitMode = pMsg .BandwidthLimitMode
413+ if pMsg .BandwidthLimit != "" {
414+ cfg .BandwidthLimit , _ = NewBandwidthQuantity (pMsg .BandwidthLimit )
415+ }
416+ if pMsg .BandwidthLimitMode != "" {
417+ cfg .BandwidthLimitMode = pMsg .BandwidthLimitMode
418+ }
412419 cfg .Group = pMsg .Group
413420 cfg .GroupKey = pMsg .GroupKey
414421 cfg .Metas = pMsg .Metas
You can’t perform that action at this time.
0 commit comments