The WebSocket object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.

Documentation WebSocket by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Constructor

new (url:String, protocols:Array<String>)

new (url:String)

new (url:String, protocols:String)

Throws:

null

DOMError

Variables

Methods

close (?code:Int, ?reason:String):Void

Throws:

null

DOMError

send (data:ArrayBufferView):Void

send (data:String):Void

send (data:Blob):Void

send (data:ArrayBuffer):Void

Throws:

null

DOMError

Static variables

staticinline read onlyCLOSED:Int = 3

staticinline read onlyCLOSING:Int = 2

staticinline read onlyCONNECTING:Int = 0

staticinline read onlyOPEN:Int = 1

Inherited Variables

Inherited Methods

Defined by EventTarget

addEventListener (type:String, listener:Function, capture:Bool = false):Void

addEventListener (type:String, listener:EventListener, capture:Bool = false, ?wantsUntrusted:Bool):Void

Throws:

null

DOMError

dispatchEvent (event:Event):Bool

Throws:

null

DOMError

removeEventListener (type:String, listener:Function, capture:Bool = false):Void

removeEventListener (type:String, listener:EventListener, capture:Bool = false):Void

Throws:

null

DOMError