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

Index

Properties

CLOSED

CLOSED: number

CLOSING

CLOSING: number

CONNECTING

CONNECTING: number

EventTarget

EventTarget: object

Type declaration

  • constructor: function
    • 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?: number, reason?: string): void
  • Parameters

    • Optional code: number
    • Optional reason: 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

    Returns boolean

removeEventListener

send

Generated using TypeDoc