Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • EventTarget
    • WebSocket

Index

Properties

CLOSED

CLOSED: number

CLOSING

CLOSING: number

CONNECTING

CONNECTING: number

EventTarget

EventTarget: object

Type declaration

  • constructor: function
    • new __type(): EventTarget
    • Returns EventTarget

  • prototype: EventTarget

OPEN

OPEN: number

binaryType

binaryType: BinaryType

bufferedAmount

bufferedAmount: number

extensions

extensions: string

onclose

onclose: function | null

onerror

onerror: function | null

onmessage

onmessage: function | null

onopen

onopen: function | null

protocol

protocol: string

readyState

readyState: number

url

url: string

Methods

addEventListener

close

  • close(code?: undefined | number, reason?: undefined | string): void
  • Parameters

    • Optional code: undefined | number
    • Optional reason: undefined | string

    Returns void

dispatchEvent

  • dispatchEvent(event: Event): boolean
  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    Parameters

    • event: Event

    Returns boolean

removeEventListener

send

Generated using TypeDoc