TsgcWebSocketServer_HTTPAPIProperties › Extensions

Extensions Property

Configures WebSocket protocol extensions such as per-message deflate compression.

Syntax

public TsgcWSExtensions Extensions { get; set; }

Default Value

PerMessage_Deflate.Enabled=False

Remarks

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.

Example


oServer = new TsgcWebSocketServer_HTTPAPI();
oServer.Extensions.PerMessage_Deflate.Enabled = true;
oServer.Active = true;

Back to Properties