TsgcWebSocketServerProperties › Bindings

Bindings Property

Collection of IP/Port pairs the server listens on; use it to bind several endpoints simultaneously.

Syntax

public TIdSocketHandles Bindings { get; set; }

Default Value

— (empty; server falls back to Port on all interfaces)

Remarks

Add one entry per IP/Port combination the server must listen on. Each entry exposes IP, Port and IPVersion; when the collection is empty the server binds to every interface on Port. Use Bindings to serve both an HTTP and an HTTPS endpoint on the same component, or to restrict the server to one physical interface. Call Bindings.Clear() after stopping the server if you plan to reassign the listening endpoints before restarting.

Example


oServer = new TsgcWebSocketServer();
oServer.Bindings = "127.0.0.1:80,127.0.0.1:443";
oServer.Active = true;

Back to Properties