Skip to content

KellyKinyama/dart-webrtc

Repository files navigation

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

About

pure dart webrtc implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages