Crate saorsa_webrtc

Crate saorsa_webrtc 

Source
Expand description

Saorsa WebRTC - WebRTC implementation over ant-quic transport

This library provides a WebRTC implementation that uses ant-quic as the underlying transport layer instead of traditional ICE/STUN/TURN. It features:

  • Native QUIC Transport: Uses ant-quic for reliable, encrypted connections
  • DHT-based Signaling: Distributed signaling without centralized servers
  • Post-Quantum Cryptography: Built-in PQC support via ant-quic
  • NAT Traversal: Automatic hole punching and relay fallback
  • High Performance: Low-latency media streaming with QoS

§Examples

use saorsa_webrtc::{WebRtcService, MediaConstraints, SignalingHandler, AntQuicTransport, TransportConfig};
use std::sync::Arc;

// Create signaling transport
let transport = Arc::new(AntQuicTransport::new(TransportConfig::default()));
let signaling = Arc::new(SignalingHandler::new(transport));

// Create WebRTC service
let service = WebRtcService::<saorsa_webrtc::PeerIdentityString, AntQuicTransport>::new(
    signaling,
    Default::default()
).await?;

// Start the service
service.start().await?;

// Initiate a video call
let call_id = service.initiate_call(
    saorsa_webrtc::PeerIdentityString::new("eve-frank-grace-henry"),
    MediaConstraints::video_call()
).await?;

Re-exports§

pub use call::CallManager;
pub use call::CallManagerConfig;
pub use identity::PeerIdentity;
pub use identity::PeerIdentityString;
pub use media::AudioDevice;
pub use media::AudioTrack;
pub use media::MediaEvent;
pub use media::MediaStream;
pub use media::MediaStreamManager;
pub use media::VideoDevice;
pub use media::VideoTrack;
pub use quic_bridge::RtpPacket;
pub use quic_bridge::StreamConfig;
pub use quic_bridge::StreamType;
pub use quic_bridge::WebRtcQuicBridge;
pub use service::WebRtcConfig;
pub use service::WebRtcEvent;
pub use service::WebRtcService;
pub use service::WebRtcServiceBuilder;
pub use signaling::SignalingHandler;
pub use signaling::SignalingMessage as SignalingMessageType;
pub use signaling::SignalingTransport;
pub use transport::AntQuicTransport;
pub use transport::TransportConfig;
pub use types::*;

Modules§

call
Call management and state Call management for WebRTC
identity
Peer identity abstraction Peer identity abstraction
media
Media stream management Media stream management for WebRTC
prelude
Prelude module for convenient imports
quic_bridge
Bridge between WebRTC and QUIC WebRTC to QUIC bridge
quic_streams
QUIC media stream management with QoS QUIC media stream management with QoS
service
WebRTC service and configuration WebRTC service orchestration
signaling
Signaling protocol and handlers WebRTC signaling protocol
transport
ant-quic transport integration Transport layer implementations
types
Core WebRTC types and data structures WebRTC types and data structures