perMessageDeflate(clientMaxWindow:clientNoContextTakeover:serverMaxWindow:serverNoContextTakeover:compressionLevel:memoryLevel:maxDecompressedFrameSize:minFrameSizeToCompress:)

permessage-deflate websocket extension

PerMessageDeflateExtension.swift:339
static func perMessageDeflate(clientMaxWindow: Int? = nil, clientNoContextTakeover: Bool = false, serverMaxWindow: Int? = nil, serverNoContextTakeover: Bool = false, compressionLevel: Int? = nil, memoryLevel: Int? = nil, maxDecompressedFrameSize: Int = 1 << 14, minFrameSizeToCompress: Int = 256) -> WebSocketExtensionFactory
  • clientMaxWindow: Max window to be used for client compression

  • clientNoContextTakeover: Should client reset window on every message

  • serverMaxWindow: Max window to be used for server compression

  • serverNoContextTakeover: Should server reset window on every message

  • compressionLevel: Zlib compression level. Value between 0 and 9 where 1 gives best speed, 9 gives give best compression and 0 gives no compression.

  • memoryLevel: Defines how much memory should be given to compression. Value between 1 and 9 where 1 uses least memory and 9 give best compression and optimal speed.

  • maxDecompressedFrameSize: Maximum size for a decompressed frame

  • minFrameSizeToCompress: Minimum size of a frame before compression is applied