TsgcWebSocketServer › Properties › Extensions
Configures WebSocket protocol extensions such as per-message deflate compression.
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. 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. Compression and the Throttle property can be combined to shape traffic.
oServer := TsgcWebSocketServer.Create(nil);
oServer.Extensions.PerMessage_Deflate.Enabled := true;
oServer.Active := true;