webSocketRaw

fun <ERROR CLASS>.webSocketRaw(path: String, protocol: String? = null, handler: suspend WebSocketServerSession.() -> Unit)

Bind RAW websocket at the current route + path optionally checking for websocket protocol (ignored if null) Requires WebSockets plugin to be installed first

Unlike regular (default) webSocket, a raw websocket is not handling any ping/pongs, timeouts or close frames. So WebSocketSession.incoming channel will contain all low-level control frames and all fragmented frames need to be reassembled

When a websocket session is created, a handler lambda will be called with websocket session instance on receiver. Once handler function returns, the websocket connection will be terminated immediately. For RAW websockets it is important to perform close sequence properly.


fun <ERROR CLASS>.webSocketRaw(path: String, protocol: String? = null, negotiateExtensions: Boolean = false, handler: suspend WebSocketServerSession.() -> Unit)

Bind RAW websocket at the current route + path optionally checking for websocket protocol (ignored if null) Requires WebSockets plugin to be installed first

Unlike regular (default) webSocket, a raw websocket is not handling any ping/pongs, timeouts or close frames. So WebSocketSession.incoming channel will contain all low-level control frames and all fragmented frames need to be reassembled

When a websocket session is created, a handler lambda will be called with websocket session instance on receiver. Once handler function returns, the websocket connection will be terminated immediately. For RAW websockets it is important to perform close sequence properly.

Parameters

negotiateExtensions

indicates if the server should negotiate installed WebSocket extensions.


fun <ERROR CLASS>.webSocketRaw(protocol: String? = null, handler: suspend WebSocketServerSession.() -> Unit)

Bind RAW websocket at the current route optionally checking for websocket protocol (ignored if null) Requires WebSockets plugin to be installed first

Unlike regular (default) webSocket, a raw websocket is not handling any ping/pongs, timeouts or close frames. So WebSocketSession's incoming channel will contain all low-level control frames and all fragmented frames need to be reassembled

When a websocket session is created, a handler lambda will be called with websocket session instance on receiver. Once handler function returns, the websocket connection will be terminated immediately. For RAW websocket it is important to perform close sequence properly.


fun <ERROR CLASS>.webSocketRaw(protocol: String? = null, negotiateExtensions: Boolean = false, handler: suspend WebSocketServerSession.() -> Unit)

Bind RAW websocket at the current route optionally checking for websocket protocol (ignored if null) Requires WebSockets plugin to be installed first

Unlike regular (default) webSocket, a raw websocket is not handling any ping/pongs, timeouts or close frames. So WebSocketSession's incoming channel will contain all low-level control frames and all fragmented frames need to be reassembled

When a websocket session is created, a handler lambda will be called with websocket session instance on receiver. Once handler function returns, the websocket connection will be terminated immediately. For RAW websocket it is important to perform close sequence properly.

Parameters

negotiateExtensions

indicates if the server should negotiate installed WebSocket extensions.


fun <ERROR CLASS>.webSocketRaw(webSocketProtocol: String, webSocketHandler: suspend WebSocketServerSession.() -> Unit, nothing: Nothing? = null)

Bind RAW websocket at the current route optionally checking for websocket protocol (ignored if null) Requires WebSockets plugin to be installed first

Unlike regular (default) webSocket, a raw websocket is not handling any ping/pongs, timeouts or close frames. So WebSocketSession's incoming channel will contain all low-level control frames and all fragmented frames need to be reassembled

When a websocket session is created, a handler lambda will be called with websocket session instance on receiver. Once handler function returns, the websocket connection will be terminated immediately. For RAW websocket it is important to perform close sequence properly.