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.

Maintainers

Package info

github.com/danog/php-rtc-turn

pkg:composer/danog/php-rtc-turn

Transparency log

Fund package maintenance!

php-webrtc

Statistics

Installs: 24

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1005 2026-08-25 17:57 UTC

This package is auto-updated.

Last update: 2026-08-25 18:48:56 UTC


README

PHP Version License

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:

PHP WebRTC Documentation

Credits

Authors

Reporting Issues

Found a bug? Please report it on our issues.

License

BSD 3-Clause License. See LICENSE for details.

References