ktor-client-core / io.ktor.client.features.websocket

Package io.ktor.client.features.websocket

Types

ClientWebSocketSession

interface ClientWebSocketSession : WebSocketSession

Client specific WebSocketSession.

DefaultClientWebSocketSession

class DefaultClientWebSocketSession : ClientWebSocketSession, DefaultWebSocketSession

ClientSpecific DefaultWebSocketSession.

WebSocketCapability

object WebSocketCapability : HttpClientEngineCapability<Unit>

Indicates if a client engine supports WebSockets.

WebSocketExtensionsCapability

object WebSocketExtensionsCapability : HttpClientEngineCapability<Unit>

Indicates if a client engine supports extensions for WebSocket feature.

WebSockets

class WebSockets

Client WebSocket feature.

Exceptions

WebSocketException

class WebSocketException : IllegalStateException

Functions

WebSockets

fun HttpClientConfig<*>.WebSockets(config: Config.() -> Unit): Unit

Install WebSockets feature using the config as configuration.

webSocket

suspend fun HttpClient.webSocket(request: HttpRequestBuilder.() -> Unit, block: suspend DefaultClientWebSocketSession.() -> Unit): Unit
suspend fun HttpClient.webSocket(method: HttpMethod = HttpMethod.Get, host: String = "localhost", port: Int = DEFAULT_PORT, path: String = "/", request: HttpRequestBuilder.() -> Unit = {}, block: suspend DefaultClientWebSocketSession.() -> Unit): Unit
suspend fun HttpClient.webSocket(urlString: String, request: HttpRequestBuilder.() -> Unit = {}, block: suspend DefaultClientWebSocketSession.() -> Unit): Unit

Open block with DefaultClientWebSocketSession.

webSocketSession

suspend fun HttpClient.webSocketSession(block: HttpRequestBuilder.() -> Unit): DefaultClientWebSocketSession
suspend fun HttpClient.webSocketSession(method: HttpMethod = HttpMethod.Get, host: String = "localhost", port: Int = DEFAULT_PORT, path: String = "/", block: HttpRequestBuilder.() -> Unit = {}): DefaultClientWebSocketSession

Open DefaultClientWebSocketSession.

ws

suspend fun HttpClient.ws(method: HttpMethod = HttpMethod.Get, host: String = "localhost", port: Int = DEFAULT_PORT, path: String = "/", request: HttpRequestBuilder.() -> Unit = {}, block: suspend DefaultClientWebSocketSession.() -> Unit): Unit
suspend fun HttpClient.ws(request: HttpRequestBuilder.() -> Unit, block: suspend DefaultClientWebSocketSession.() -> Unit): Unit
suspend fun HttpClient.ws(urlString: String, request: HttpRequestBuilder.() -> Unit = {}, block: suspend DefaultClientWebSocketSession.() -> Unit): Unit

Open block with DefaultClientWebSocketSession.

wss

suspend fun HttpClient.wss(request: HttpRequestBuilder.() -> Unit, block: suspend DefaultClientWebSocketSession.() -> Unit): Unit
suspend fun HttpClient.wss(urlString: String, request: HttpRequestBuilder.() -> Unit = {}, block: suspend DefaultClientWebSocketSession.() -> Unit): Unit
suspend fun HttpClient.wss(method: HttpMethod = HttpMethod.Get, host: String = "localhost", port: Int = DEFAULT_PORT, path: String = "/", request: HttpRequestBuilder.() -> Unit = {}, block: suspend DefaultClientWebSocketSession.() -> Unit): Unit

Open block with secure DefaultClientWebSocketSession.