WebSocket

open class WebSocket(url: String, protocols: JsAny?) : EventTarget, JsAny

Exposes the JavaScript WebSocket to Kotlin

Constructors

Link copied to clipboard
constructor(url: String, protocols: JsAny?)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val extensions: String
Link copied to clipboard
var onclose: (Event) -> Unit?
Link copied to clipboard
var onerror: (Event) -> Unit?
Link copied to clipboard
Link copied to clipboard
var onopen: (Event) -> Unit?
Link copied to clipboard
open val protocol: String
Link copied to clipboard
open val readyState: Short
Link copied to clipboard
open val url: String

Functions

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