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
clone the repo
Then run:
dart pub get
Requires Dart 3.x or later.
- API Reference
- Example usage in the
/bin
directory
GitHub: examples
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
dart bin/srtp_webrtc.dart
dart lib/src/dtls3/handshaker/client/dtls_client.dart
dart lib/src/stun3/stun_server7.dart
dart lib/src/stun3/stun_client.dart
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
- SIP
- STUN
- TURN (UDP)
- Vanilla ICE
- Trickle ICE
- ICE Restart
- ICE-Lite (Client-side)
- ICE-Lite (Server-side)
- DTLS
- DTLS-SRTP
- Curve25519
- P-256
- TLS 1.2
- DataChannel
- MediaChannel
- sendonly
- recvonly
- sendrecv
- Multi-track
- RTX
- RED
- RFC 3550 (RTP base)
- RTP Payload Formats:
- VP8
- VP9
- H264
- AV1
- RED (RFC 2198)
- RTCP:
- SR/RR
- PLI
- REMB
- NACK
- TransportWideCC
- SDP parsing and generation
- Reuse inactive m-line
- PeerConnection API
- Simulcast (recv only)
- Bandwidth Estimation (sender-side)
- OPUS
- VP8
- VP9
- H264
- AV1
- Chrome / Edge / Firefox
- Pion
- aiortc
- sipsorcery
- webrtc-rs
- Interop E2E testing
- Unit tests
- Web Platform Tests
- API compatible with browser RTCPeerConnection
- Simulcast (send support)
- TURN over TCP
-
getStats()
support - Support for more cipher suites