TsgcWebSocketFirewall › Properties › RateLimit
Caps the number of concurrent connections a single IP may open within a sliding time window.
property RateLimit: TsgcFirewallRateLimit read FRateLimit write SetRateLimit;
—
Enable RateLimit.Enabled to limit how many connections a single IP may open. When an IP establishes more than MaxConnectionsPerIP connections within TimeWindowSec seconds, further attempts are rejected and OnViolation fires with type fvRateLimit. The firewall maintains counters through RegisterConnection/UnregisterConnection, which are called automatically when the firewall is attached to a server. Matches feed ThreatScore through WeightRateLimit. Use FloodProtection for a message-rate cap. Defaults: MaxConnectionsPerIP=10, TimeWindowSec=60.
sgcWebSocketFirewall1.RateLimit.Enabled := True;
sgcWebSocketFirewall1.RateLimit.MaxConnectionsPerIP := 5;
sgcWebSocketFirewall1.RateLimit.TimeWindowSec := 60;