Function reconstructSDP

  • Reconstructs a minimal SDP from QWBP data (without candidates)

    Candidates should be added separately via RTCPeerConnection.addIceCandidate() to avoid browser-specific SDP parsing issues with IPv6, mDNS, etc.

    Parameters

    • fingerprint: Uint8Array

      32-byte DTLS fingerprint

    • isOffer: boolean

      Whether this is an offer (true) or answer (false)

    • Optionalcredentials: IceCredentials

      Optional pre-computed credentials (if not provided, will derive)

    Returns Promise<string>

    Reconstructed SDP string (without candidates)

    const sdp = await reconstructSDP(remoteFingerprint, true);
    await pc.setRemoteDescription({ type: 'offer', sdp });
    // Then add candidates via addIceCandidate()