Tony Blundell
class WsClient { private val url = "<http://example.com>" private val httpClient = HttpClient { install(WebSockets) } suspend fun start() { httpClient.wss(HttpMethod.Get, url) { send("Hello") while (true) { when (val frame = incoming.receive()) { is Frame.Text -> println(frame.readText()) is Frame.Binary -> println(frame.readBytes()) } } } } } fun main() = runBlocking { WsClient().start() }
Matteo Mirk
A modern programming language that makes developers happier.