package js.html
extends EventTarget
Available on js
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 also:
staticinlineread onlyCLOSED:Int = 3staticinlineread onlyCLOSING:Int = 2staticinlineread onlyCONNECTING:Int = 0staticinlineread onlyOPEN:Int = 1new(url:String, protocols:Array<String>)new(url:String)new(url:String, protocols:String)Throws:
null |
DOMError |
|---|
binaryType:BinaryTypeThe binary data type used by the connection.
read onlybufferedAmount:IntThe number of bytes of queued data.
read onlyextensions:StringThe extensions selected by the server.
onclose:FunctionAn event listener to be called when the connection is closed.
onerror:FunctionAn event listener to be called when an error occurs.
onmessage:FunctionAn event listener to be called when a message is received from the server.
onopen:FunctionAn event listener to be called when the connection is opened.
read onlyprotocol:StringThe sub-protocol selected by the server.
read onlyreadyState:IntThe current state of the connection.
read onlyurl:StringThe absolute URL of the WebSocket.
close(?code:Int, ?reason:String):VoidThrows:
null |
DOMError |
|---|
send(data:ArrayBufferView):Voidsend(data:String):Voidsend(data:Blob):Voidsend(data:ArrayBuffer):VoidThrows:
null |
DOMError |
|---|
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/WebSocket.html