TsgcWebSocketLoadBalancerServer › Properties › Bindings
Collection of IP/Port pairs the load balancer listens on for downstream clients and backend registrations.
property Bindings: TIdSocketHandles read GetBindings write SetBindings;
— (empty; load balancer falls back to Port on all interfaces)
Add one entry per IP/Port combination the load balancer 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 expose a public front-end on one interface and a dedicated administration/backend-registration endpoint on another, or to run plain and TLS listeners on the same component. Note that the addresses listed here are where downstream clients and backend TsgcWebSocketServer instances connect — they are not the public addresses forwarded to clients (those are advertised by each backend through its own LoadBalancer.Bindings). Call Bindings.Clear() after stopping before reassigning the listening endpoints.
oServer := TsgcWebSocketLoadBalancerServer.Create(nil);
With oServer.Bindings.Add do
begin
IP := '0.0.0.0';
Port := 80;
end;
With oServer.Bindings.Add do
begin
IP := '0.0.0.0';
Port := 443;
end;
oServer.Active := true;