feat: multi-node device limit, optimize rate limiter
This commit is contained in:
@@ -159,7 +159,7 @@ func (d *LimitDispatcher) identifyAndCheck(ctx context.Context, dest net.Destina
|
||||
isTCP = dest.Network == net.Network_TCP
|
||||
|
||||
if d.checkDeviceLimit(email, sourceIP, isTCP) {
|
||||
nlog.Core().Info("xray: device limit exceeded", "email", email, "ip", sourceIP)
|
||||
nlog.Core().Debug("xray: device limit exceeded", "email", email, "ip", sourceIP)
|
||||
return "", "", false, errors.New("device limit exceeded for " + email)
|
||||
}
|
||||
return email, sourceIP, isTCP, nil
|
||||
|
||||
@@ -244,6 +244,12 @@ func (x *Xray) SetSpeedLimitFunc(_ func(string) *rate.Limiter) {}
|
||||
// gate-kept by LimitDispatcher.checkDeviceLimit at Dispatch time.
|
||||
func (x *Xray) SetDeviceLimitFunc(_ func(string) (int, bool)) {}
|
||||
|
||||
// UpdateGlobalDevices is a no-op for xray — xray handles device limits differently.
|
||||
func (x *Xray) UpdateGlobalDevices(_ map[int][]string) {}
|
||||
|
||||
// ClearGlobalDevices is a no-op for xray.
|
||||
func (x *Xray) ClearGlobalDevices() {}
|
||||
|
||||
// ─── User management (non-disruptive where possible) ────────────────────────
|
||||
|
||||
// AddUsers adds new users to the running kernel via xray's UserManager API.
|
||||
|
||||
Reference in New Issue
Block a user