TsgcWebSocketProxyServer › Properties › Throttle
Caps the bandwidth (bits per second) that the proxy reads from or writes to each downstream connection.
property Throttle: TsgcWSThrottle read GetThrottle write SetThrottle;
Enabled=False
When Throttle.Enabled is True the proxy limits how fast data may be read from or written to each downstream connection. Use it to prevent a single client from saturating the uplink to the upstream server configured in Proxy or to simulate low-bandwidth scenarios during development. Throttling is applied at the socket level and is independent from MaxConnections (which caps concurrent sessions). Throttling affects only the downstream socket; it does not change the rate at which the upstream link reads/writes data.
oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.Throttle.BitsPerSec := 65536;
oProxy.Throttle.Enabled := true;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;