- Index
- »
- fan.dom
- »
- HttpSocket
HttpSocket
@Js
class HttpSocket : Obj
HttpSocket implements an async WebSocket client
Event fired when the web socket is closed
Event fired when the web socket is closed due to an error
Event fired when the web socket is opened
Event fired when the web socket receives a message
Close the web socket
Send the data as a message - data must be a Str or in-memory Buf
Uri passed to the open method
Open a web socket to given URI with sub-protocol list
This close()
Close the web socket.
Void onClose(|Event| f)
Event fired when the web socket is closed
Void onError(|Event| f)
Event fired when the web socket is closed due to an error
Void onOpen(|Event| f)
Event fired when the web socket is opened
Void onReceive(|Event| f)
Event fired when the web socket receives a message. The message payload is available as a Str or Buf via Event.data
static HttpSocket open(Uri uri, Str[]? protocols)
Open a web socket to given URI with sub-protocol list
This send(Obj data)
Send the data as a message - data must be a Str or in-memory Buf
Uri uri()
Uri passed to the open method