class dom::HttpSocket

sys::Obj
  dom::HttpSocket

@Js

Source

HttpSocket implements an async WebSocket client

close

This close()

Source

Close the web socket.

onClose

Void onClose(|Event| f)

Source

Event fired when the web socket is closed

onError

Void onError(|Event| f)

Source

Event fired when the web socket is closed due to an error

onOpen

Void onOpen(|Event| f)

Source

Event fired when the web socket is opened

onReceive

Void onReceive(|Event| f)

Source

Event fired when the web socket receives a message. The message payload is available as a Str or Buf via Event.data

open

static HttpSocket open(Uri uri, Str[]? protocols)

Source

Open a web socket to given URI with sub-protocol list

send

This send(Obj data)

Source

Send the data as a message - data must be a Str or in-memory Buf

uri

Uri uri()

Source

Uri passed to the open method