TsgcWebSocketProxyServer › Properties › MaxConnections
Maximum number of concurrent downstream client connections accepted by the proxy.
property MaxConnections: Integer read GetMaxConnections write SetMaxConnections;
0 (unlimited)
When MaxConnections is greater than zero the proxy refuses new incoming TCP connections from downstream clients once the limit is reached; existing sessions (and their corresponding upstream links to the server defined in Proxy) are unaffected. Use this property to protect the host from resource exhaustion or to cap capacity when several proxies sit behind a common load balancer. A value of 0 disables the limit. Remember that every accepted downstream client opens an additional outbound connection toward the upstream server, so the effective socket consumption is roughly doubled.
oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.Port := 80;
oProxy.MaxConnections := 1000;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;