spring-framework / org.springframework.web.socket / WebSocketExtension

WebSocketExtension

open class WebSocketExtension

Represents a WebSocket extension as defined in the RFC 6455. WebSocket extensions add protocol features to the WebSocket protocol. The extensions used within a session are negotiated during the handshake phase as follows:

WebSocket Extension HTTP headers may include parameters and follow RFC 7230 section 3.2

Note that the order of extensions in HTTP headers defines their order of execution, e.g. extensions "foo, bar" will be executed as "bar(foo(message))".

Author
Brian Clozel

Author
Juergen Hoeller

Since
4.0

See Also
<a href="https://tools.ietf.org/html/rfc6455#section-9">WebSocket Protocol Extensions, RFC 6455 - Section 9</a>

Constructors

<init>

WebSocketExtension(name: String)

Create a WebSocketExtension with the given name.

WebSocketExtension(name: String, parameters: MutableMap<String, String>)

Create a WebSocketExtension with the given name and parameters.

Functions

equals

open fun equals(other: Any?): Boolean

getName

open fun getName(): String

Return the name of the extension (never null) or empty.

getParameters

open fun getParameters(): MutableMap<String, String>

Return the parameters of the extension (never null).

hashCode

open fun hashCode(): Int

parseExtensions

open static fun parseExtensions(extensions: String): MutableList<WebSocketExtension>

Parse the given, comma-separated string into a list of WebSocketExtension objects.

This method can be used to parse a "Sec-WebSocket-Extension" header.

toString

open fun toString(): String

Inheritors

StandardToWebSocketExtensionAdapter

open class StandardToWebSocketExtensionAdapter : WebSocketExtension

A sub-class of org.springframework.web.socket.WebSocketExtension that can be constructed from an javax.websocket.Extension.