pingInterval: Duration?,
    timeout: Duration,
    maxFrameSize: Long,
    masking: Boolean)

WebSockets support feature. It is required to be installed first before binding any websocket endpoints


install(Routing) {
    webSocket("/ws") {
         incoming.consumeForEach { ... }


pingInterval - duration between pings or null to disable pings

timeout - write/ping timeout after that a connection will be closed

maxFrameSize - maximum frame that could be received or sent

masking - whether masking need to be enabled (useful for security)