pure_dart_webrtc 1.0.0 copy "pure_dart_webrtc: ^1.0.0" to clipboard
pure_dart_webrtc: ^1.0.0 copied to clipboard

A pure Dart implementation of WebRTC, including support for ICE, STUN, TURN, DTLS, TLS, SRTP, RTP, RTCP, and SDP.

dart_webrtc #

dart_webrtc (WebrTC Implementation for The Dart language)

A pure Dart implementation of WebRTC, including support for ICE, STUN, TURN, DTLS, TLS, SRTP, RTP, RTCP, and SDP.

Inspired by webrtc-nuts-and-bolts


📦 Installation #

clone the repo

Then run:

dart pub get

Requires Dart 3.x or later.


📚 Documentation (WIP) #


💡 Examples #

GitHub: examples

DTLS server #

dart bin/srtp_webrtc.dart
dart bin/dart_webrtc.dart
dart lib/src/dtls/examples/server/psk_ccm8.dart
dart lib/src/dtls/examples/server/psk_ccm.dart

SRTP/DTLS server #

dart bin/srtp_webrtc.dart

DTLS client #

dart lib/src/dtls3/handshaker/client/dtls_client.dart

STUN Server #

dart lib/src/stun3/stun_server7.dart

STUN client #

dart lib/src/stun3/stun_client.dart

STUN/DTLS/SRTP/RTCP multiplexing #

This example recieves stun, dtls, rtp packets. It decrypts, encrypts and sends the packets back to the sender. copy the sdp offer from this file:

lib\src\sdp8\sdp_test.dart

Adjust the the fingerprint and ice candidate

cd WebRTC-Simple-SDP-Handshake-Demo
php -S localhost:3000

Navigate to the link in your browser=> localhost:3000 Paste the sdp in the sdp offer box

Run this command

dart bin\srtp_webrtc.dart

In your browser, click create answer


🎯 Roadmap #

✅ Version 1.0 Goals #

Signaling & NAT traversal

  • ✅ SIP
  • ✅ STUN
  • ❌ TURN (UDP)

ICE

  • ✅ Vanilla ICE
  • ✅ Trickle ICE
  • ❌ ICE Restart
  • ✅ ICE-Lite (Client-side)
  • ❌ ICE-Lite (Server-side)

Security

  • ✅ DTLS
    • ✅ DTLS-SRTP
    • ✅ Curve25519
    • ✅ P-256
  • ❌ TLS 1.2

Channels

  • ❌ DataChannel
  • ❌ MediaChannel
    • ❌ sendonly
    • ❌ recvonly
    • ❌ sendrecv
    • ❌ Multi-track
    • ❌ RTX
    • ❌ RED

RTP/RTCP

  • ❌ RFC 3550 (RTP base)
  • ❌ RTP Payload Formats:
    • ❌ VP8
    • ❌ VP9
    • ❌ H264
    • ❌ AV1
    • ❌ RED (RFC 2198)
  • ❌ RTCP:
    • ❌ SR/RR
    • ❌ PLI
    • ❌ REMB
    • ❌ NACK
    • ❌ TransportWideCC

SDP / PeerConnection

  • ✅ SDP parsing and generation
    • ✅ Reuse inactive m-line
  • ❌ PeerConnection API
  • ❌ Simulcast (recv only)
  • ❌ Bandwidth Estimation (sender-side)

Media Recorder

  • ❌ OPUS
  • ❌ VP8
  • ❌ VP9
  • ❌ H264
  • ❌ AV1

Compatibility & Interop

  • ✅ Chrome / Edge / Firefox
  • ❌ Pion
  • ❌ aiortc
  • ❌ sipsorcery
  • ✅ webrtc-rs
  • ❌ Interop E2E testing

Testing

  • ❌ Unit tests
  • ❌ Web Platform Tests

🔜 Roadmap for 2.0 #

  • ❌ API compatible with browser RTCPeerConnection
  • ❌ Simulcast (send support)
  • ❌ TURN over TCP
  • getStats() support
  • ❌ Support for more cipher suites

🔗 References #

1
likes
40
points
10
downloads

Publisher

unverified uploader

Weekly Downloads

A pure Dart implementation of WebRTC, including support for ICE, STUN, TURN, DTLS, TLS, SRTP, RTP, RTCP, and SDP.

Repository (GitHub)
View/report issues

License

GPL-3.0 (license)

Dependencies

asn1lib, basic_utils, bits, collection, convert, crypto, cryptography, dotenv, dtls2, ecdsa, elliptic, events_emitter, ffi, fixnum, hex, intl, opus_dart, pointycastle, sdp_transform, shelf, shelf_web_socket, uuid, web_socket_channel, x25519, x509b

More

Packages that depend on pure_dart_webrtc