Extensions for io.ktor.routing.Route

webSocket

fun Route.webSocket(
    protocol: String? = null,
    handler: suspend DefaultWebSocketServerSession.() -> Unit
): Unit

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

fun Route.webSocket(
    path: String,
    protocol: String? = null,
    handler: suspend DefaultWebSocketServerSession.() -> Unit
): Unit

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

webSocketRaw

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

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

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

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