method WebSocketHandlers.onMessage
WebSocketHandlers.onMessage(
data: string | Uint8Array
): void | Promise<void>

Called for every inbound frame.

Parameters

The connection that received the frame

data: string | Uint8Array

Text as string, binary as Uint8Array

Return Type

void | Promise<void>

Usage

import { type WebSocketHandlers } from "common/src/index.ts";