method Room.prototype.broadcastLocal
Since 0.2.0
Room.prototype.broadcastLocal(
data: string | Uint8Array,
): void

Sends a frame to this replica's own members only, without forwarding it to the backplane.

This is the delivery path for a frame that ARRIVED from another replica: re-publishing it would echo it back around the cluster forever. Applications call Room.broadcast; only the plugin's backplane subscriber calls this.

Exclusion is honored two ways: options.except names a live connection object (the local path), and options.exceptId names one by ID (the path a frame arriving from another replica takes, since the excluded connection object does not exist here).

Parameters

data: string | Uint8Array

Text as string, binary as Uint8Array

optional
options: LocalBroadcastOptions

Broadcast options, including exclusion by ID

Return Type

void

Usage

import { Room } from "websocket-plugin/src/index.ts";