TsgcWebSocketProxyServer › Properties › Extensions
Configures WebSocket protocol extensions such as per-message deflate compression for the downstream leg.
property Extensions: TsgcWSExtensions read GetExtensions write SetExtensions;
PerMessage_Deflate.Enabled=False
Enable Extensions.PerMessage_Deflate.Enabled to advertise and negotiate the permessage-deflate compression extension defined in RFC 7692 with the downstream client. If the connecting client does not advertise support, messages are exchanged uncompressed automatically, so there is no interoperability risk. Compression reduces bandwidth at the cost of CPU time; tune the sub-properties (ServerNoContextTakeOver, ClientNoContextTakeOver, ServerMaxWindowBits, ClientMaxWindowBits, MemLevel) to trade memory against compression ratio. Extensions negotiated here apply only to the downstream leg; the upstream link to the server configured in Proxy is a separate WebSocket session.
oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.Extensions.PerMessage_Deflate.Enabled := true;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;