TsgcWebSocketProxyServerProperties › LoadBalancer

LoadBalancer Property

Configures the built-in client used to register this proxy with a Load Balancer Server instance.

Syntax

property LoadBalancer: TsgcWSLoadBalancerServer_Options read FLoadBalancer write SetLoadBalancer;

Default Value

Enabled=False

Remarks

Enable the load-balancer client to let this proxy publish its bindings to a central TsgcWSLoadBalancerServer so that the load balancer can route new downstream clients to it. AutoRegisterBindings automatically advertises the bindings configured on this proxy; alternatively fill the Bindings list manually with entries in WS://host:port or WSS://host:port form. AutoRestart sets the number of seconds to wait before reconnecting after a load-balancer disconnection (0 disables auto-restart). Guid identifies this proxy on the load-balancer side; Host and Port point to the load-balancer endpoint — these are unrelated to the upstream target configured in Proxy. The events OnLoadBalancerConnect, OnLoadBalancerDisconnect and OnLoadBalancerError report connection state.

Example


oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.LoadBalancer.Host := 'lb.example.com';
oProxy.LoadBalancer.Port := 80;
oProxy.LoadBalancer.AutoRegisterBindings := true;
oProxy.LoadBalancer.Enabled := true;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;

Back to Properties