2026-07-07 11:07:59 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
feat: WebRTC MVP to Blax standard (namespace, README, tests, scaffolding)
- Rename namespace BlaxSoftware\LaravelWebRtc -> Blax\WebRtc (house standard) +
update kernel imports to Blax\ReactPhpKernel
- README rewritten to the Blax OSS package principles: OSS banner, title+badges,
emoji feature list, quick start, wire shape, config, architecture, star history
- Add PHPUnit suite (8 tests / 18 assertions, green): SignalingHandler routing
(offer/ice/record/connect/bridge/close/error paths via a fake engine) +
NullMediaEngine behaviour
- Add pint.json (laravel preset, applied), composer scripts, .gitattributes,
test.sh (nix), CHANGELOG
- Verified end-to-end: composer install resolves blax-software/reactphp-kernel
from Forgejo VCS and the suite runs green on it
rel learn-atc #1055 #1051 #1019
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 11:28:49 +00:00
|
|
|
namespace Blax\WebRtc;
|
2026-07-07 11:07:59 +00:00
|
|
|
|
2026-07-08 09:22:53 +00:00
|
|
|
use Blax\ReactPhpKernel\Kernel;
|
feat: full package — typed rooms (public/private/presence/open-presence) + call recording
Rooms
- Rooms\RoomType derived from the name prefix (like laravel-websockets channels):
public, private-* (authorized), presence-* (authorized + member list),
open-presence-* (public + member list). Room/RoomManager carry per-member info.
- Contracts\RoomAuthorizer + secure DefaultRoomAuthorizer (denies private/presence
until the host binds one). Presence rooms broadcast the member list + info.
Recording (store the FULL call audio, in PHP, today)
- Pure-P2P audio is DTLS-SRTP end-to-end, so the server can't capture it. Instead
the browser MediaRecords its mic and streams chunks over the WS as BINARY frames
(needs the new laravel-ws onBinary); RelaySignalingHandler appends them per
participant via a RecordingStore. Recording\FileRecordingStore -> <room>/<peer>.webm.
welcome/joined carry a record flag telling the client to stream.
- Contracts\CallEventListener call-log seam (peer/room/recording lifecycle) so calls
are auditable even when unrecorded.
Wiring
- RelaySignalingHandler(authorizer, recorder, events); webrtc:serve + provider +
config/webrtc.php (recording enabled/path/format, authorizer, events).
Tests 35/99 incl on-disk FileRecordingStore, presence member lists, auth gating,
binary recording+finalize+events, RoomType, and the real WS round-trip. README
documents room types + the browser MediaRecorder->WS recording flow.
rel learn-atc #1060 #1055 #1057 #1051
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 07:01:12 +00:00
|
|
|
use Blax\WebRtc\Authorization\DefaultRoomAuthorizer;
|
feat: Rust SFU data plane — backend-hosted rooms, plug-and-play sidecar binary
rust/ becomes a standalone static binary (blax-webrtc-sfu, tokio-free
std-thread loop on str0m): terminates ICE/DTLS/SRTP, forwards Opus between
room peers without decoding, records per-peer Ogg/Opus (ffprobe-verified),
server-side mute/kick, stats + peer_connected/peer_left usage events, all
driven by PHP over a JSON-lines Unix control socket. Renegotiation rides the
browser data channel (str0m chat model) — signaling only carries the initial
offer/answer.
PHP side: RustMediaEngine (MediaEngine contract + room-aware API) is
plug-and-play — first use downloads the sha256-verified prebuilt binary
(BinaryManager, RoadRunner pattern) and spawns it detached, flock-guarded
(SidecarSupervisor). webrtc:install / webrtc:sidecar provided for explicit
control; config gains the webrtc.sfu block. Replaces the ext-php-rs
Str0mMediaEngine seam.
Tests: 61 PHP (incl. a real PHP<->Rust E2E that spawns the sidecar from
PHPUnit) + 7 Rust (incl. an end-to-end control-socket integration test).
build-release.sh produces the static-musl release + .sha256 (verified:
static-pie, 9.2MB, runs).
Card #1083 (rel #1051 #1060 #1064).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 09:29:26 +00:00
|
|
|
use Blax\WebRtc\Console\Commands\InstallSfuBinary;
|
|
|
|
|
use Blax\WebRtc\Console\Commands\RunSfuSidecar;
|
feat: WebRTC MVP to Blax standard (namespace, README, tests, scaffolding)
- Rename namespace BlaxSoftware\LaravelWebRtc -> Blax\WebRtc (house standard) +
update kernel imports to Blax\ReactPhpKernel
- README rewritten to the Blax OSS package principles: OSS banner, title+badges,
emoji feature list, quick start, wire shape, config, architecture, star history
- Add PHPUnit suite (8 tests / 18 assertions, green): SignalingHandler routing
(offer/ice/record/connect/bridge/close/error paths via a fake engine) +
NullMediaEngine behaviour
- Add pint.json (laravel preset, applied), composer scripts, .gitattributes,
test.sh (nix), CHANGELOG
- Verified end-to-end: composer install resolves blax-software/reactphp-kernel
from Forgejo VCS and the suite runs green on it
rel learn-atc #1055 #1051 #1019
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 11:28:49 +00:00
|
|
|
use Blax\WebRtc\Console\Commands\StartWebRtcServer;
|
feat: full package — typed rooms (public/private/presence/open-presence) + call recording
Rooms
- Rooms\RoomType derived from the name prefix (like laravel-websockets channels):
public, private-* (authorized), presence-* (authorized + member list),
open-presence-* (public + member list). Room/RoomManager carry per-member info.
- Contracts\RoomAuthorizer + secure DefaultRoomAuthorizer (denies private/presence
until the host binds one). Presence rooms broadcast the member list + info.
Recording (store the FULL call audio, in PHP, today)
- Pure-P2P audio is DTLS-SRTP end-to-end, so the server can't capture it. Instead
the browser MediaRecords its mic and streams chunks over the WS as BINARY frames
(needs the new laravel-ws onBinary); RelaySignalingHandler appends them per
participant via a RecordingStore. Recording\FileRecordingStore -> <room>/<peer>.webm.
welcome/joined carry a record flag telling the client to stream.
- Contracts\CallEventListener call-log seam (peer/room/recording lifecycle) so calls
are auditable even when unrecorded.
Wiring
- RelaySignalingHandler(authorizer, recorder, events); webrtc:serve + provider +
config/webrtc.php (recording enabled/path/format, authorizer, events).
Tests 35/99 incl on-disk FileRecordingStore, presence member lists, auth gating,
binary recording+finalize+events, RoomType, and the real WS round-trip. README
documents room types + the browser MediaRecorder->WS recording flow.
rel learn-atc #1060 #1055 #1057 #1051
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 07:01:12 +00:00
|
|
|
use Blax\WebRtc\Contracts\CallEventListener;
|
feat: WebRTC MVP to Blax standard (namespace, README, tests, scaffolding)
- Rename namespace BlaxSoftware\LaravelWebRtc -> Blax\WebRtc (house standard) +
update kernel imports to Blax\ReactPhpKernel
- README rewritten to the Blax OSS package principles: OSS banner, title+badges,
emoji feature list, quick start, wire shape, config, architecture, star history
- Add PHPUnit suite (8 tests / 18 assertions, green): SignalingHandler routing
(offer/ice/record/connect/bridge/close/error paths via a fake engine) +
NullMediaEngine behaviour
- Add pint.json (laravel preset, applied), composer scripts, .gitattributes,
test.sh (nix), CHANGELOG
- Verified end-to-end: composer install resolves blax-software/reactphp-kernel
from Forgejo VCS and the suite runs green on it
rel learn-atc #1055 #1051 #1019
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 11:28:49 +00:00
|
|
|
use Blax\WebRtc\Contracts\MediaEngine;
|
2026-07-08 09:22:53 +00:00
|
|
|
use Blax\WebRtc\Contracts\RecordingStore;
|
feat: full package — typed rooms (public/private/presence/open-presence) + call recording
Rooms
- Rooms\RoomType derived from the name prefix (like laravel-websockets channels):
public, private-* (authorized), presence-* (authorized + member list),
open-presence-* (public + member list). Room/RoomManager carry per-member info.
- Contracts\RoomAuthorizer + secure DefaultRoomAuthorizer (denies private/presence
until the host binds one). Presence rooms broadcast the member list + info.
Recording (store the FULL call audio, in PHP, today)
- Pure-P2P audio is DTLS-SRTP end-to-end, so the server can't capture it. Instead
the browser MediaRecords its mic and streams chunks over the WS as BINARY frames
(needs the new laravel-ws onBinary); RelaySignalingHandler appends them per
participant via a RecordingStore. Recording\FileRecordingStore -> <room>/<peer>.webm.
welcome/joined carry a record flag telling the client to stream.
- Contracts\CallEventListener call-log seam (peer/room/recording lifecycle) so calls
are auditable even when unrecorded.
Wiring
- RelaySignalingHandler(authorizer, recorder, events); webrtc:serve + provider +
config/webrtc.php (recording enabled/path/format, authorizer, events).
Tests 35/99 incl on-disk FileRecordingStore, presence member lists, auth gating,
binary recording+finalize+events, RoomType, and the real WS round-trip. README
documents room types + the browser MediaRecorder->WS recording flow.
rel learn-atc #1060 #1055 #1057 #1051
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 07:01:12 +00:00
|
|
|
use Blax\WebRtc\Contracts\RoomAuthorizer;
|
2026-07-08 09:22:53 +00:00
|
|
|
use Blax\WebRtc\Contracts\RoomStore;
|
feat: full package — typed rooms (public/private/presence/open-presence) + call recording
Rooms
- Rooms\RoomType derived from the name prefix (like laravel-websockets channels):
public, private-* (authorized), presence-* (authorized + member list),
open-presence-* (public + member list). Room/RoomManager carry per-member info.
- Contracts\RoomAuthorizer + secure DefaultRoomAuthorizer (denies private/presence
until the host binds one). Presence rooms broadcast the member list + info.
Recording (store the FULL call audio, in PHP, today)
- Pure-P2P audio is DTLS-SRTP end-to-end, so the server can't capture it. Instead
the browser MediaRecords its mic and streams chunks over the WS as BINARY frames
(needs the new laravel-ws onBinary); RelaySignalingHandler appends them per
participant via a RecordingStore. Recording\FileRecordingStore -> <room>/<peer>.webm.
welcome/joined carry a record flag telling the client to stream.
- Contracts\CallEventListener call-log seam (peer/room/recording lifecycle) so calls
are auditable even when unrecorded.
Wiring
- RelaySignalingHandler(authorizer, recorder, events); webrtc:serve + provider +
config/webrtc.php (recording enabled/path/format, authorizer, events).
Tests 35/99 incl on-disk FileRecordingStore, presence member lists, auth gating,
binary recording+finalize+events, RoomType, and the real WS round-trip. README
documents room types + the browser MediaRecorder->WS recording flow.
rel learn-atc #1060 #1055 #1057 #1051
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 07:01:12 +00:00
|
|
|
use Blax\WebRtc\Events\NullCallEventListener;
|
feat: WebRTC MVP to Blax standard (namespace, README, tests, scaffolding)
- Rename namespace BlaxSoftware\LaravelWebRtc -> Blax\WebRtc (house standard) +
update kernel imports to Blax\ReactPhpKernel
- README rewritten to the Blax OSS package principles: OSS banner, title+badges,
emoji feature list, quick start, wire shape, config, architecture, star history
- Add PHPUnit suite (8 tests / 18 assertions, green): SignalingHandler routing
(offer/ice/record/connect/bridge/close/error paths via a fake engine) +
NullMediaEngine behaviour
- Add pint.json (laravel preset, applied), composer scripts, .gitattributes,
test.sh (nix), CHANGELOG
- Verified end-to-end: composer install resolves blax-software/reactphp-kernel
from Forgejo VCS and the suite runs green on it
rel learn-atc #1055 #1051 #1019
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 11:28:49 +00:00
|
|
|
use Blax\WebRtc\Media\NullMediaEngine;
|
feat: Rust SFU data plane — backend-hosted rooms, plug-and-play sidecar binary
rust/ becomes a standalone static binary (blax-webrtc-sfu, tokio-free
std-thread loop on str0m): terminates ICE/DTLS/SRTP, forwards Opus between
room peers without decoding, records per-peer Ogg/Opus (ffprobe-verified),
server-side mute/kick, stats + peer_connected/peer_left usage events, all
driven by PHP over a JSON-lines Unix control socket. Renegotiation rides the
browser data channel (str0m chat model) — signaling only carries the initial
offer/answer.
PHP side: RustMediaEngine (MediaEngine contract + room-aware API) is
plug-and-play — first use downloads the sha256-verified prebuilt binary
(BinaryManager, RoadRunner pattern) and spawns it detached, flock-guarded
(SidecarSupervisor). webrtc:install / webrtc:sidecar provided for explicit
control; config gains the webrtc.sfu block. Replaces the ext-php-rs
Str0mMediaEngine seam.
Tests: 61 PHP (incl. a real PHP<->Rust E2E that spawns the sidecar from
PHPUnit) + 7 Rust (incl. an end-to-end control-socket integration test).
build-release.sh produces the static-musl release + .sha256 (verified:
static-pie, 9.2MB, runs).
Card #1083 (rel #1051 #1060 #1064).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 09:29:26 +00:00
|
|
|
use Blax\WebRtc\Media\Rust\BinaryManager;
|
|
|
|
|
use Blax\WebRtc\Media\Rust\SidecarSupervisor;
|
2026-07-08 09:22:53 +00:00
|
|
|
use Blax\WebRtc\Realtime\OpenAiRealtimeBridge;
|
|
|
|
|
use Blax\WebRtc\Recording\FileRecordingStore;
|
|
|
|
|
use Blax\WebRtc\Rooms\RoomManager;
|
|
|
|
|
use Blax\WebRtc\Rooms\Stores\ArrayRoomStore;
|
|
|
|
|
use Blax\Ws\WebSocketServer;
|
2026-07-07 11:07:59 +00:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
|
|
class WebRtcServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
public function register(): void
|
|
|
|
|
{
|
feat: WebRTC MVP to Blax standard (namespace, README, tests, scaffolding)
- Rename namespace BlaxSoftware\LaravelWebRtc -> Blax\WebRtc (house standard) +
update kernel imports to Blax\ReactPhpKernel
- README rewritten to the Blax OSS package principles: OSS banner, title+badges,
emoji feature list, quick start, wire shape, config, architecture, star history
- Add PHPUnit suite (8 tests / 18 assertions, green): SignalingHandler routing
(offer/ice/record/connect/bridge/close/error paths via a fake engine) +
NullMediaEngine behaviour
- Add pint.json (laravel preset, applied), composer scripts, .gitattributes,
test.sh (nix), CHANGELOG
- Verified end-to-end: composer install resolves blax-software/reactphp-kernel
from Forgejo VCS and the suite runs green on it
rel learn-atc #1055 #1051 #1019
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 11:28:49 +00:00
|
|
|
$this->mergeConfigFrom(__DIR__.'/../config/webrtc.php', 'webrtc');
|
2026-07-07 11:07:59 +00:00
|
|
|
|
|
|
|
|
// Resolve the configured media engine wherever a MediaEngine is type-hinted.
|
|
|
|
|
$this->app->bind(MediaEngine::class, function ($app) {
|
|
|
|
|
$class = (string) config('webrtc.media_engine', NullMediaEngine::class);
|
|
|
|
|
|
|
|
|
|
return $app->make($class);
|
|
|
|
|
});
|
feat: full package — typed rooms (public/private/presence/open-presence) + call recording
Rooms
- Rooms\RoomType derived from the name prefix (like laravel-websockets channels):
public, private-* (authorized), presence-* (authorized + member list),
open-presence-* (public + member list). Room/RoomManager carry per-member info.
- Contracts\RoomAuthorizer + secure DefaultRoomAuthorizer (denies private/presence
until the host binds one). Presence rooms broadcast the member list + info.
Recording (store the FULL call audio, in PHP, today)
- Pure-P2P audio is DTLS-SRTP end-to-end, so the server can't capture it. Instead
the browser MediaRecords its mic and streams chunks over the WS as BINARY frames
(needs the new laravel-ws onBinary); RelaySignalingHandler appends them per
participant via a RecordingStore. Recording\FileRecordingStore -> <room>/<peer>.webm.
welcome/joined carry a record flag telling the client to stream.
- Contracts\CallEventListener call-log seam (peer/room/recording lifecycle) so calls
are auditable even when unrecorded.
Wiring
- RelaySignalingHandler(authorizer, recorder, events); webrtc:serve + provider +
config/webrtc.php (recording enabled/path/format, authorizer, events).
Tests 35/99 incl on-disk FileRecordingStore, presence member lists, auth gating,
binary recording+finalize+events, RoomType, and the real WS round-trip. README
documents room types + the browser MediaRecorder->WS recording flow.
rel learn-atc #1060 #1055 #1057 #1051
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 07:01:12 +00:00
|
|
|
|
|
|
|
|
// Room authorization (private/presence) + the call-event log — host-overridable.
|
|
|
|
|
$this->app->bind(RoomAuthorizer::class, function ($app) {
|
|
|
|
|
return $app->make((string) config('webrtc.authorizer', DefaultRoomAuthorizer::class));
|
|
|
|
|
});
|
|
|
|
|
$this->app->bind(CallEventListener::class, function ($app) {
|
|
|
|
|
return $app->make((string) config('webrtc.events', NullCallEventListener::class));
|
|
|
|
|
});
|
2026-07-08 09:22:53 +00:00
|
|
|
|
|
|
|
|
// Room membership store — swappable so a fork-per-message host (learn-atc's
|
|
|
|
|
// existing WS) can back it with Cache/Redis instead of process memory. The
|
|
|
|
|
// RoomManager is per-resolve so a fresh worker reads current state.
|
|
|
|
|
$this->app->bind(RoomStore::class, function ($app) {
|
|
|
|
|
return $app->make((string) config('webrtc.room_store', ArrayRoomStore::class));
|
|
|
|
|
});
|
|
|
|
|
$this->app->bind(RoomManager::class, function ($app) {
|
|
|
|
|
return new RoomManager($app->make(RoomStore::class));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Where a call's audio is stored (per participant). Host may override the class.
|
|
|
|
|
$this->app->bind(RecordingStore::class, function () {
|
|
|
|
|
$recording = (array) config('webrtc.recording', []);
|
|
|
|
|
|
|
|
|
|
return new FileRecordingStore(
|
|
|
|
|
(string) ($recording['path'] ?? 'webrtc'),
|
|
|
|
|
(string) ($recording['format'] ?? 'webm'),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
feat: Rust SFU data plane — backend-hosted rooms, plug-and-play sidecar binary
rust/ becomes a standalone static binary (blax-webrtc-sfu, tokio-free
std-thread loop on str0m): terminates ICE/DTLS/SRTP, forwards Opus between
room peers without decoding, records per-peer Ogg/Opus (ffprobe-verified),
server-side mute/kick, stats + peer_connected/peer_left usage events, all
driven by PHP over a JSON-lines Unix control socket. Renegotiation rides the
browser data channel (str0m chat model) — signaling only carries the initial
offer/answer.
PHP side: RustMediaEngine (MediaEngine contract + room-aware API) is
plug-and-play — first use downloads the sha256-verified prebuilt binary
(BinaryManager, RoadRunner pattern) and spawns it detached, flock-guarded
(SidecarSupervisor). webrtc:install / webrtc:sidecar provided for explicit
control; config gains the webrtc.sfu block. Replaces the ext-php-rs
Str0mMediaEngine seam.
Tests: 61 PHP (incl. a real PHP<->Rust E2E that spawns the sidecar from
PHPUnit) + 7 Rust (incl. an end-to-end control-socket integration test).
build-release.sh produces the static-musl release + .sha256 (verified:
static-pie, 9.2MB, runs).
Card #1083 (rel #1051 #1060 #1064).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 09:29:26 +00:00
|
|
|
// The Rust SFU sidecar (backend-hosted rooms): binary management + the
|
|
|
|
|
// process supervisor RustMediaEngine boots plug-and-play on first use.
|
|
|
|
|
$this->app->singleton(BinaryManager::class, function () {
|
|
|
|
|
return new BinaryManager((array) config('webrtc.sfu', []));
|
|
|
|
|
});
|
|
|
|
|
$this->app->singleton(SidecarSupervisor::class, function ($app) {
|
|
|
|
|
return new SidecarSupervisor($app->make(BinaryManager::class), (array) config('webrtc.sfu', []));
|
|
|
|
|
});
|
|
|
|
|
|
2026-07-08 09:22:53 +00:00
|
|
|
// Realtime AI bridge (provider hidden from the browser, model swappable server-side).
|
|
|
|
|
$this->app->bind(OpenAiRealtimeBridge::class, function () {
|
|
|
|
|
$endpoint = (string) config('webrtc.bridge.openai.endpoint', 'wss://api.openai.com/v1/realtime');
|
|
|
|
|
|
|
|
|
|
return new OpenAiRealtimeBridge(endpoint: $endpoint);
|
|
|
|
|
});
|
2026-07-07 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function boot(): void
|
|
|
|
|
{
|
|
|
|
|
if ($this->app->runningInConsole()) {
|
|
|
|
|
$this->publishes([
|
feat: WebRTC MVP to Blax standard (namespace, README, tests, scaffolding)
- Rename namespace BlaxSoftware\LaravelWebRtc -> Blax\WebRtc (house standard) +
update kernel imports to Blax\ReactPhpKernel
- README rewritten to the Blax OSS package principles: OSS banner, title+badges,
emoji feature list, quick start, wire shape, config, architecture, star history
- Add PHPUnit suite (8 tests / 18 assertions, green): SignalingHandler routing
(offer/ice/record/connect/bridge/close/error paths via a fake engine) +
NullMediaEngine behaviour
- Add pint.json (laravel preset, applied), composer scripts, .gitattributes,
test.sh (nix), CHANGELOG
- Verified end-to-end: composer install resolves blax-software/reactphp-kernel
from Forgejo VCS and the suite runs green on it
rel learn-atc #1055 #1051 #1019
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 11:28:49 +00:00
|
|
|
__DIR__.'/../config/webrtc.php' => $this->app->configPath('webrtc.php'),
|
2026-07-07 11:07:59 +00:00
|
|
|
], 'webrtc-config');
|
|
|
|
|
|
feat: Rust SFU data plane — backend-hosted rooms, plug-and-play sidecar binary
rust/ becomes a standalone static binary (blax-webrtc-sfu, tokio-free
std-thread loop on str0m): terminates ICE/DTLS/SRTP, forwards Opus between
room peers without decoding, records per-peer Ogg/Opus (ffprobe-verified),
server-side mute/kick, stats + peer_connected/peer_left usage events, all
driven by PHP over a JSON-lines Unix control socket. Renegotiation rides the
browser data channel (str0m chat model) — signaling only carries the initial
offer/answer.
PHP side: RustMediaEngine (MediaEngine contract + room-aware API) is
plug-and-play — first use downloads the sha256-verified prebuilt binary
(BinaryManager, RoadRunner pattern) and spawns it detached, flock-guarded
(SidecarSupervisor). webrtc:install / webrtc:sidecar provided for explicit
control; config gains the webrtc.sfu block. Replaces the ext-php-rs
Str0mMediaEngine seam.
Tests: 61 PHP (incl. a real PHP<->Rust E2E that spawns the sidecar from
PHPUnit) + 7 Rust (incl. an end-to-end control-socket integration test).
build-release.sh produces the static-musl release + .sha256 (verified:
static-pie, 9.2MB, runs).
Card #1083 (rel #1051 #1060 #1064).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 09:29:26 +00:00
|
|
|
// The Rust SFU sidecar commands have no extra PHP dependencies.
|
|
|
|
|
$this->commands([
|
|
|
|
|
InstallSfuBinary::class,
|
|
|
|
|
RunSfuSidecar::class,
|
|
|
|
|
]);
|
|
|
|
|
|
2026-07-08 09:22:53 +00:00
|
|
|
// The bundled ReactPHP relay server needs blax-software/laravel-ws +
|
|
|
|
|
// reactphp-kernel (dev-only deps). A host that only consumes the domain
|
|
|
|
|
// layer (rooms/recording/realtime bridge) on its OWN transport won't have
|
|
|
|
|
// them — checking the dependency classes first avoids autoloading the
|
|
|
|
|
// command (and its imports) when they're absent.
|
|
|
|
|
if (class_exists(WebSocketServer::class) && class_exists(Kernel::class)) {
|
|
|
|
|
$this->commands([
|
|
|
|
|
StartWebRtcServer::class,
|
|
|
|
|
]);
|
|
|
|
|
}
|
2026-07-07 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|