danog / php-rtc-dtls
Pure-PHP DTLS 1.2 for WebRTC, powered by phpseclib and Amp v3.
Fund package maintenance!
Requires
- php: ^8.2
- amphp/amp: ^3.1.3
- danog/php-rtc-exception: ^1.1.5
- danog/php-rtc-ice: ^1.1.18 || ^2.0
- danog/php-rtc-mixin: ^2.0
- danog/php-rtc-rtp: ^1.1.13 || ^2.0
- danog/php-rtc-sctp: ^1.1.5 || ^2.0
- danog/php-rtc-sdp: ^1.1.6
- danog/php-rtc-srtp: ^1.1.7
- danog/php-rtc-stats: ^1.1.3
- evenement/evenement: ^3.0.2
- phpseclib/phpseclib: ^3.0.57
- symfony/polyfill-php84: *
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.9.1
- dg/bypass-finals: dev-master
- phpunit/phpunit: ^11.5 || ^12.0 || ^13.3.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A PHP implementation of Datagram Transport Layer Security (DTLS), designed for secure communication over UDP, especially in real-time communication protocols such as WebRTC and SRTP.
About this fork
This is the danog/php-rtc-dtls fork used by MadelineProto. It targets PHP 8.2+, runs on Amp v3 fibers, and uses the pure-PHP DTLS 1.2 engine backed by phpseclib instead of OpenSSL FFI. Its handshake driver includes timer, retransmission, and packet-loss recovery fixes validated against independent DTLS implementations.
All internal Composer dependencies use their danog/php-rtc-* package names directly, so installing a component selects the maintained danog packages throughout the dependency graph.
Features
- DTLS 1.2 handshake implementation
- Secure communication over UDP
- Certificate and key generation
- Integration-ready with SRTP (Secure RTP)
- Peer authentication
Requirements
- PHP ≥ 8.2
- phpseclib 3 (installed through Composer)
Documentation
This package is part of the PHP WebRTC library. For complete documentation, examples, and API reference, visit:
Credits
Authors
-
Amin Yazdanpanah
- Website: aminyazdanpanah.com
- Email: github@aminyazdanpanah.com
-
Sana Moniri
- GtiHub: sanamoniri
Reporting Issues
Found a bug? Please report it on our issues.
License
BSD 3-Clause License. See LICENSE for details.