WebSocketDeflateExtension
class WebSocketDeflateExtension : WebSocketExtension<Config>
Compress and decompress WebSocket frames to reduce amount of transferred bytes.
Usage
install(WebSockets) {
extensions {
install(WebSocketDeflateExtension)
}
}
Implements WebSocket deflate extension from RFC-7692. This implementation is using window size = 15 due to limitations of Deflater implementation.
Types
companion object Companion : |
|
class Config WebSocket deflate extension configuration. |
Properties
val factory: WebSocketExtensionFactory<Config, out WebSocketExtension<Config>> Reference to the WebSocketExtensionFactory, which produced this extension. |
|
val protocols: List<WebSocketExtensionHeader> List of WebSocket extension protocols which will be sent by client in headers. They are required to inform server that client wants to negotiate current extension. |
Functions
fun clientNegotiation( This method is called only for a client, when it receives the WebSocket upgrade response. |
|
This method is called on each incoming frame before handling it in WebSocket session. |
|
This method is called on each outgoing frame and handle it before sending. |
|
fun serverNegotiation( This method is called only for a server, when it receives websocket session. |
Companion Object Properties
val key: AttributeKey<WebSocketDeflateExtension> Key is used to locate extension. |
|
val rsv1: Boolean First extension bit used by current extension. |
|
val rsv2: Boolean Second extension bit used by current extension. |
|
val rsv3: Boolean Third extension bit used by current extension. |
Companion Object Functions
fun install( Create extension instance using config block. The extension instance is created for each WebSocket request. |