NetherNet transport for PHP
The WebRTC transport used by Minecraft: Bedrock Edition
NetherNet only handles the transport: signaling, identity, framing and connection lifecycle. Packets and gameplay belong to the server.
- PHP 8.1+ with OpenSSL
- ext-rtc built for the running PHP (ZTS for Amber)
$transport = new Transport($config, $identityHandler, $listener,
static fn() => new ExtRtcPeer($config, 20000, 20127, $bindAddress));- Port range
20000, 20127gives each player its own UDP port. - One port for everyone with
udpMux: trueandbegin === end. On Windows it needs an explicit bind address. - Behind port forwarding pass
advertisedAddress: 'public ip'. The forwarded port must match the local one. Connection::send()returningACCEPTEDmeans local admission, not delivery.Connection::getStats()returns RTT and byte counters while open.
composer check
php -d extension=/path/to/rtc.so vendor/bin/phpunit -c phpunit.rtc.xml.distWithout ext-rtc use composer install --ignore-platform-req=ext-rtc for the fake backend tests. ExtWebRtcPeer remains as a legacy backend; never load ext-rtc and ext-webrtc together.