WebSocket

open external class WebSocket(url: String, protocols: dynamic = definedExternally) : EventTarget

Exposes the JavaScript WebSocket to Kotlin

Constructors

Link copied to clipboard
fun WebSocket(url: String, protocols: dynamic = definedExternally)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addEventListener(    type: String,     callback: (Event) -> Unit?,     options: dynamic = definedExternally)
fun addEventListener(    type: String,     callback: EventListener?,     options: dynamic = definedExternally)
Link copied to clipboard
fun close(code: Short = definedExternally, reason: String = definedExternally)
Link copied to clipboard
fun dispatchEvent(event: Event): Boolean
Link copied to clipboard
fun removeEventListener(    type: String,     callback: (Event) -> Unit?,     options: dynamic = definedExternally)
fun removeEventListener(    type: String,     callback: EventListener?,     options: dynamic = definedExternally)
Link copied to clipboard
fun send(data: String)
fun send(data: ArrayBuffer)
fun send(data: Blob)

Properties

Link copied to clipboard
Link copied to clipboard
open val bufferedAmount: Number
Link copied to clipboard
open val extensions: String
Link copied to clipboard
var onclose: (Event) -> dynamic?
Link copied to clipboard
var onerror: (Event) -> dynamic?
Link copied to clipboard
var onmessage: (MessageEvent) -> dynamic?
Link copied to clipboard
var onopen: (Event) -> dynamic?
Link copied to clipboard
open val protocol: String
Link copied to clipboard
open val readyState: Short
Link copied to clipboard
open val url: String