TsgcWebSocketHTTPServerProperties › Firewall

Firewall Property

Assigns a firewall component that filters incoming connections by IP, region or custom rules.

Syntax

public TsgcWSFirewall Firewall { get; set; }

Default Value

nil

Remarks

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 or HTTP request 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.

Example


oServer = new TsgcWebSocketHTTPServer();
oServer.Firewall = oFirewall;
oServer.Active = true;

Back to Properties