libp2p
    Preparing search index...

    Interface WebRTCTransportDirectInit

    interface WebRTCTransportDirectInit {
        certificate?: TransportCertificate;
        certificateDatastoreKey?: string;
        certificateKeychainName?: string;
        certificateLifespan?: number;
        certificateRenewalThreshold?: number;
        dataChannel?: DataChannelOptions;
        dialerVersion?: 1 | 2;
        maxEarlyStreams?: number;
        rtcConfiguration?:
            | RTCConfiguration
            | (() => RTCConfiguration | Promise<RTCConfiguration>);
    }

    Hierarchy

    Index
    certificate?: TransportCertificate

    Use an existing TLS certificate to secure incoming connections or supply settings to generate one.

    This must be an ECDSA certificate using the P-256 curve.

    From our testing we find that P-256 elliptic curve is supported by Pion, webrtc-rs, as well as Chromium (P-228 and P-384 was not supported in Chromium).

    certificateDatastoreKey?: string

    The key the certificate is stored in the datastore under

    '/libp2p/webrtc-direct/certificate'
    
    certificateKeychainName?: string

    The name the certificate private key is stored in the keychain with

    'webrtc-direct-certificate-private-key'
    
    certificateLifespan?: number

    Number of ms a certificate should be valid for (defaults to 14 days)

    2_592_000_000
    
    certificateRenewalThreshold?: number

    Certificates will be renewed this many ms before expiry (defaults to 1 day)

    86_400_000
    
    dataChannel?: DataChannelOptions

    The default configuration used by all created RTCDataChannels

    dialerVersion?: 1 | 2

    Force the version of the WebRTC Direct connection flow to dial with. When not set, the first dial tries v1 and continues as v2 if the runtime does not apply the munged ICE credentials in the local SDP offer, and later dials start at whichever version that showed the runtime supports. The server must support the version in use, listeners accept both.

    maxEarlyStreams?: number

    Caps the inbound streams accepted before the connection surfaces them, and the data channels buffered before the muxer exists (excess are closed).

    10
    
    rtcConfiguration?:
        | RTCConfiguration
        | (() => RTCConfiguration | Promise<RTCConfiguration>)

    The default configuration used by all created RTCPeerConnections