Registry / web-framework / ktor-websockets

ktor-websockets

JSON →
library3.4.2javamavenunverified

Ktor is a framework for quickly creating web applications in Kotlin with minimal effort.

<dependency> <groupId>io.ktor</groupId> <artifactId>ktor-websockets</artifactId> <version>3.4.2</version> </dependency>
INSTALL
IMPORT
SIG · KTOR-WEBSOCKETS
K
ktor-websockets
web-frameworkjavav3.4.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WebSocketSession
io.ktor.websocket.WebSocketSession

Sets up a simple WebSocket echo server.

import io.ktor.websocket.* import io.ktor.server.routing.* import io.ktor.server.engine.* import io.ktor.server.netty.* fun main() { embeddedServer(Netty, port = 8080) { routing { webSocket("/chat") { send("Hello!") for (frame in incoming) { if (frame is Frame.Text) { send("Echo: ${frame.readText()}") } } } } }.start(wait = true) }
Debug
Known issues
breakingKtor 3.x has breaking changes from 2.x, especially in routing and plugin APIs.
fix
Refer to the migration guide: https://ktor.io/docs/migrating-2-to-3.html
affects: >=3.0.0
Upgrade
Version history
3.4.2latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
ktor-websockets — mvn dependency:get ktor-websockets · libregistry