TsgcWebSocketFirewall › Properties › FloodProtection
Caps the number of messages per second a single IP may send to protect against message-flood attacks.
property FloodProtection: TsgcFirewallFloodProtection read FFloodProtection write SetFloodProtection;
—
Enable FloodProtection.Enabled to throttle per-IP message rate. When an IP sends more than MaxMessagesPerSec messages during a one-second window, subsequent messages are handled according to Action: faDeny rejects them, faAllow forwards them and faLog only records a violation. OnViolation fires with type fvFlood, and matches feed ThreatScore through WeightFlood. Pair with RateLimit (connection-rate) and PayloadLimit (message-size) for layered denial-of-service protection. Defaults: MaxMessagesPerSec=100, Action=faDeny.
sgcWebSocketFirewall1.FloodProtection.Enabled := True;
sgcWebSocketFirewall1.FloodProtection.MaxMessagesPerSec := 50;
sgcWebSocketFirewall1.FloodProtection.Action := faDeny;