danog / php-rtc-turn
TURN relay transport for PHP WebRTC, ported to Amp v3 TCP, UDP, and fibers. MadelineProto's PHP 8.2+ fork supports the modular danog/php-rtc stack.
Fund package maintenance!
Requires
- php: ^8.2
- amphp/amp: ^3.1
- amphp/socket: ^2.3
- danog/php-rtc-exception: ^1.0
- danog/php-rtc-mixin: ^1.0
- danog/php-rtc-stun: ^1.0
- psr/log: ^3.0
Requires (Dev)
- mockery/mockery: ^1.6
- phpunit/php-code-coverage: 11.0.x-dev
- phpunit/phpunit: ^11.3
README
A PHP implementation of TURN (Traversal Using Relays around NAT) to facilitate NAT traversal for WebRTC by relaying media through a TURN server when peer-to-peer fails.
About this fork
This is the danog/php-rtc-turn fork used by MadelineProto. It targets PHP 8.2+ and replaces ReactPHP with Amp v3 TCP/UDP sockets, blocking fiber APIs, and per-peer channel-bind coordination. Receive handlers run independently so nested TURN/STUN transactions cannot block their own replies.
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
- Encode and decode TURN allocation and channel messages
- Relay address allocation
- Integrates with STUN and ICE workflows
- Message integrity and credential verification
Requirements
- PHP ≥ 8.2
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.