Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

References

Re-exports Server
Re-exports WebSocket

Type aliases

CertMeta: string | string[] | Buffer | Buffer[]

CertMeta represents the accepted types for certificate & key data.

Data: string | Buffer | ArrayBuffer | Buffer[]

Data represents the message payload received over the WebSocket.

RawData: Buffer | ArrayBuffer | Buffer[]

Data represents the raw message payload received over the WebSocket.

VerifyClientCallbackAsync: (info: { origin: string; req: IncomingMessage; secure: boolean }, callback: (res: boolean, code?: number, message?: string, headers?: OutgoingHttpHeaders) => void) => void

Type declaration

    • (info: { origin: string; req: IncomingMessage; secure: boolean }, callback: (res: boolean, code?: number, message?: string, headers?: OutgoingHttpHeaders) => void): void
    • VerifyClientCallbackAsync is an asynchronous callback used to inspect the incoming message. The return value (boolean) of the function determines whether or not to accept the handshake.

      Parameters

      • info: { origin: string; req: IncomingMessage; secure: boolean }
        • origin: string
        • req: IncomingMessage
        • secure: boolean
      • callback: (res: boolean, code?: number, message?: string, headers?: OutgoingHttpHeaders) => void
          • (res: boolean, code?: number, message?: string, headers?: OutgoingHttpHeaders): void
          • Parameters

            • res: boolean
            • Optional code: number
            • Optional message: string
            • Optional headers: OutgoingHttpHeaders

            Returns void

      Returns void

VerifyClientCallbackSync: (info: { origin: string; req: IncomingMessage; secure: boolean }) => boolean

Type declaration

    • (info: { origin: string; req: IncomingMessage; secure: boolean }): boolean
    • VerifyClientCallbackSync is a synchronous callback used to inspect the incoming message. The return value (boolean) of the function determines whether or not to accept the handshake.

      Parameters

      • info: { origin: string; req: IncomingMessage; secure: boolean }
        • origin: string
        • req: IncomingMessage
        • secure: boolean

      Returns boolean

Variables

WebSocketServer: typeof Server

Functions

  • createWebSocketStream(websocket: WebSocket, options?: DuplexOptions): Duplex
  • Parameters

    • websocket: WebSocket
    • Optional options: DuplexOptions

    Returns Duplex