WebSocket Firewall

TsgcWebSocketFirewall — a comprehensive firewall component that protects your WebSocket and HTTP servers against fifteen distinct classes of attack, from IP blacklists to SQL injection and command injection.

TsgcWebSocketFirewall

Pluggable firewall component — black-list / white-list incoming connections by IP, country or arbitrary rule before they reach your server logic.

Component class

TsgcWebSocketFirewall

Protocol

Server-side filter — works with WebSocket and HTTP/1.1/2 listeners.

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Professional / Enterprise

Drop the component, set a few properties, go

Create a firewall, hook OnFirewallBlackList / OnFirewallWhiteList, then attach to the server.

uses
  sgcWebSocket, sgcWebSocket_Server, sgcWebSocket_Firewall;

var
  Firewall: TsgcWebSocketFirewall;
  WSServer: TsgcWebSocketHTTPServer;
begin
  Firewall := TsgcWebSocketFirewall.Create(nil);
  Firewall.OnFirewallBlackList := DoBlackList;
  Firewall.OnFirewallWhiteList := DoWhiteList;

  WSServer := TsgcWebSocketHTTPServer.Create(nil);
  WSServer.Port := 80;
  WSServer.Firewall := Firewall;
  WSServer.Active := True;
end;

procedure TForm1.DoBlackList(Sender: TObject;
  const aIP: string; var Blocked: Boolean);
begin
  Blocked := IsBannedRange(aIP);
end;
TsgcWebSocketFirewall *Firewall = new TsgcWebSocketFirewall(this);
Firewall->OnFirewallBlackList = DoBlackList;
Firewall->OnFirewallWhiteList = DoWhiteList;

TsgcWebSocketHTTPServer *WSServer = new TsgcWebSocketHTTPServer(this);
WSServer->Port = 80;
WSServer->Firewall = Firewall;
WSServer->Active = true;

What's inside

16 published properties, 20 methods, 4 events — pulled from the component reference.

Core

Properties: Enabled.

Rules

Properties: Blacklist, Whitelist, CustomRules.

Attack protection

Properties: BruteForce, SQLInjection, XSS.

Rate limiting

Properties: RateLimit, FloodProtection.

Threat system

Properties: ThreatScore, BanEscalation.

Geo-location

Properties: GeoIP.

Specifications & references

Authoritative sources for the protocols this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Online Help — TsgcWebSocketFirewall Full property, method and event reference for this component.
Demo Project — 01.WebSocket\07.Firewall Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Add Production-Grade Protection

Download the free trial and protect your sgcWebSockets servers in minutes.