BroadcastChannel Driver
The BroadcastChannel Driver is a signaling driver that utilizes the BroadcastChannel API to enable communication between different tabs or windows of the same browser. This driver is ideal for scenarios where you want to establish peer-to-peer connections between multiple tabs or windows without the need for a server or external signaling mechanism.
Usage
To use the BroadcastChannel Driver, simply import it from the Peerix library and create an instance:
import { BroadcastChannelDriver } from 'peerix';
const driver = new BroadcastChannelDriver('my-app-channel');In this example, we create a new instance of the BroadcastChannel Driver and specify a channel name ('my-app-channel') that will be used for communication between tabs. All tabs that create a BroadcastChannel Driver instance with the same channel name will be able to discover each other and exchange messages.