TsgcWebSocketServer › Properties › Firewall
Assigns a firewall component that filters incoming connections by IP, region or custom rules.
property Firewall: TsgcWSFirewall read FFirewall write SetFirewall;
nil
Drop a TsgcWebSocketFirewall component on the form (or create it at runtime) and assign it to Firewall to enable allow/deny rules for incoming connections based on IP address, CIDR range or a custom policy. When assigned, every new TCP connection is matched against the firewall rules before the WebSocket handshake is processed; rejected peers are dropped immediately. This property is compiled only when the SGC_FIREWALL conditional is defined. Leave unassigned to disable the firewall.
oServer := TsgcWebSocketServer.Create(nil);
oServer.Firewall := oFirewall;
oServer.Active := true;