peerix - v0.6.0
    Preparing search index...

    Interface RoomOptions

    Configuration options for creating a Room instance.

    interface RoomOptions {
        connectionTimeout?: number;
        driver?: Driver;
        iceCandidateDebounce?: number;
        iceServers?: IceServer[];
        iceTransportPolicy?: IceTransportPolicy;
        id?: string;
        namespaceHashing?: boolean;
        signalingCompression?: boolean;
        signalingEncryption?: boolean;
        verify?: (
            options: { id: string; metadata?: Record<string, unknown> },
        ) => boolean | Promise<boolean>;
    }
    Index
    connectionTimeout?: number

    Connection timeout in seconds. By default, it is set to 15 seconds. Use 0 to disable the timeout.

    driver?: Driver

    Signaling driver instance for message exchange between peers. If omitted, a default in-memory driver is used, which is suitable for testing purposes only.

    iceCandidateDebounce?: number

    Debounce time in milliseconds for batching ICE candidates before sending them through signaling to minimize the number of messages. By default, it is set to 50 ms.

    iceServers?: IceServer[]

    An array of objects, each describing one server which may be used by the ICE agent; these are typically STUN and/or TURN servers. If this isn't specified, the connection attempt will be made with no STUN or TURN server available, which limits the connection to local peers. Empty by default.

    iceServers: [{
    urls: "stun:stun.l.google.com:19302"
    }]
    iceTransportPolicy?: IceTransportPolicy

    ICE policy used by created RTCPeerConnection instances. If set to "relay", only relay candidates will be used, otherwise all candidates will be considered.

    id?: string

    Unique identifier for the room. Uses "default" if omitted.

    namespaceHashing?: boolean

    Enable hashing of namespaces in signaling messages for privacy. Enabled by default.

    signalingCompression?: boolean

    Enable compression for signaling messages to reduce bandwidth usage by about 30%. Enabled by default.

    signalingEncryption?: boolean

    Encrypt signaling messages with AES-GCM for end-to-end security. Enabled by default.

    verify?: (
        options: { id: string; metadata?: Record<string, unknown> },
    ) => boolean | Promise<boolean>

    Optional callback to accept or reject incoming peer connections.

    Type Declaration

      • (
            options: { id: string; metadata?: Record<string, unknown> },
        ): boolean | Promise<boolean>
      • Parameters

        • options: { id: string; metadata?: Record<string, unknown> }

          Options describing the incoming peer connection.

          • id: string

            Remote peer identifier.

          • Optionalmetadata?: Record<string, unknown>

            Remote peer metadata.

        Returns boolean | Promise<boolean>

        A boolean or promise indicating whether the incoming connection should be accepted.