peerix - v0.1.0
    Preparing search index...

    Class BroadcastChannelDriver

    BroadcastChannel-based signaling driver for intra-origin communication.

    This driver is useful for testing and debugging purposes, but is not suitable for production use due to its limitations (e.g. same-origin restriction).

    const driver = new BroadcastChannelDriver('peerix');
    

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get active(): boolean

      Indicates whether the driver is currently active.

      Returns boolean

    • set active(value: boolean): void

      Sets the active state of the driver and emits corresponding events.

      Parameters

      • value: boolean

      Returns void

    Methods

    • Dispatches a signaling message to the specified namespace.

      Parameters

      • namespace: string[]

        The namespace to dispatch the message to.

      • message: Uint8Array

        The message to dispatch.

      Returns Promise<void>

    • Subscribes to signaling messages for the specified namespace.

      Parameters

      • namespace: string[]

        The namespace to subscribe to.

      • handler: (message: Uint8Array) => void

        The handler function to call when a message is received.

      Returns Promise<void>

    • Unsubscribes from signaling messages for the specified namespace.

      Parameters

      • namespace: string[]

        The namespace to unsubscribe from.

      • handler: (message: Uint8Array) => void

        The handler function to remove.

      Returns Promise<void>