PHPackages                             danog/php-rtc-turn - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. danog/php-rtc-turn

ActiveLibrary

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.

v1.0.1005(today)024↑2650%1BSD-3-ClausePHPPHP ^8.2CI passing

Since May 13Pushed todayCompare

[ Source](https://github.com/danog/php-rtc-turn)[ Packagist](https://packagist.org/packages/danog/php-rtc-turn)[ Docs](https://github.com/danog/php-rtc-turn)[ GitHub Sponsors](https://github.com/php-webrtc)[ RSS](/packages/danog-php-rtc-turn/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (9)Versions (8)Used By (1)

TURN Library for PHP
====================

[](#turn-library-for-php)

[![PHP Version](https://camo.githubusercontent.com/c5e8da782b1a0673c08b4f474108036d2cc973470eed2d5d89d48e8c8475eee6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c75652e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](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
---------------

[](#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
--------

[](#features)

- Encode and decode TURN allocation and channel messages
- Relay address allocation
- Integrates with STUN and ICE workflows
- Message integrity and credential verification

Requirements
------------

[](#requirements)

- PHP ≥ 8.2

Documentation
-------------

[](#documentation)

This package is part of the PHP WebRTC library. For complete documentation, examples, and API reference, visit:

[PHP WebRTC Documentation](https://github.com/danog/php-rtc-turn)

Credits
-------

[](#credits)

### Authors

[](#authors)

- **Amin Yazdanpanah**

    - Website: [aminyazdanpanah.com](https://www.aminyazdanpanah.com)
    - Email:
- **Sana Moniri**

    - GtiHub: [sanamoniri](https://github.com/sanamoniri)

Reporting Issues
----------------

[](#reporting-issues)

Found a bug? Please report it on our [issues](https://github.com/php-webrtc/TURN/issues).

License
-------

[](#license)

BSD 3-Clause License. See [LICENSE](LICENSE) for details.

References
----------

[](#references)

- [RFC 5766 – Traversal Using Relays around NAT (TURN)](https://datatracker.ietf.org/doc/html/rfc5766)
- [RFC 8656 – TURNbis](https://datatracker.ietf.org/doc/html/rfc8656)

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance100

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~78 days

Recently: every ~8 days

Total

7

Last Release

0d ago

PHP version history (2 changes)v1.0.0PHP ^8.4

v1.0.1000PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1586cd637028e4f8da85f2252b8f4b81e05f6b17a93f92c34ff064dd838e6bb?d=identicon)[danog](/maintainers/danog)

---

Top Contributors

[![danog](https://avatars.githubusercontent.com/u/7339644?v=4)](https://github.com/danog "danog (11 commits)")

---

Tags

WebRTCturntraversal-using-relays-around-nat

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/danog-php-rtc-turn/health.svg)

```
[![Health](https://phpackages.com/badges/danog-php-rtc-turn/health.svg)](https://phpackages.com/packages/danog-php-rtc-turn)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[amphp/http-server

A non-blocking HTTP application server for PHP based on Amp.

1.3k7.8M127](/packages/amphp-http-server)[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.5k920.5k24](/packages/danog-madelineproto)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.5M254](/packages/api-platform-metadata)[koriym/xdebug-mcp

Universal PHP Xdebug MCP Server with AI-optimized debugging support

5431.7k1](/packages/koriym-xdebug-mcp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
