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:
Static variables
@:value(3)staticinlineread onlyCLOSED:Int = 3
@:value(2)staticinlineread onlyCLOSING:Int = 2
@:value(1)staticinlineread onlyOPEN:Int = 1
Constructor
new(url:String, protocols:Array<String>)
new(url:String)
new(url:String, protocols:String)
Variables
The binary data type used by the connection.
The number of bytes of queued data.
The extensions selected by the server.
An event listener to be called when the connection is closed.
An event listener to be called when an error occurs.
An event listener to be called when a message is received from the server.
An event listener to be called when the connection is opened.
The sub-protocol selected by the server.
The current state of the connection.
read onlyurl:String
The absolute URL of the WebSocket.
Methods
close(?code:Int, ?reason:String):Void
Inherited Variables
Inherited Methods