openrtc 0.2.1

OpenRTC: a Rust-first P2P runtime for device discovery, signaling, and iroh/QUIC networking.
Documentation
#[cfg(target_arch = "wasm32")]
pub mod wasm {
    use wasm_bindgen::prelude::*;
    use web_sys::{RtcConfiguration, RtcDataChannel, RtcPeerConnection};

    /// Legacy WASM WebRTC proof-of-concept.
    ///
    /// Production browser WebRTC is owned by TypeScript `WebRTCTransport`; do
    /// not wire this type into the SDK/runtime path.
    #[wasm_bindgen]
    #[doc(hidden)]
    pub struct WasmConnection {
        pc: RtcPeerConnection,
    }

    #[wasm_bindgen]
    impl WasmConnection {
        #[wasm_bindgen(constructor)]
        pub fn new() -> Result<WasmConnection, JsValue> {
            let config = RtcConfiguration::new();

            let pc = RtcPeerConnection::new_with_configuration(&config)?;
            Ok(Self { pc })
        }

        pub fn create_data_channel(&self, label: &str) -> RtcDataChannel {
            self.pc.create_data_channel(label)
        }
    }
}