sfu-signaling: real Janus signaling service implementation

- JanusClient.php: HTTP REST client for Janus Gateway API
- SfuRoomRepository.php: room + participant + stats persistence
- bootstrap.php: PDO, auth, Janus client factory
- public/index.php: front-controller routing
- public/health.php: Janus online check
- public/api/rooms.php: list/create/destroy rooms
- public/api/join.php: SDP offer relay → Janus VideoRoom
- public/api/stats.php: bitrate/packet-loss analytics ingest
- public/dashboard.php: SFU rooms UI (common BE dark-theme styles)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-06-28 22:27:59 +02:00
parent ece49a035a
commit 0658e26ae4
9 changed files with 723 additions and 0 deletions

22
public/health.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
require_once dirname(__DIR__) . '/src/bootstrap.php';
header('Content-Type: application/json; charset=utf-8');
$janus = janusClient();
$info = $janus->info();
$online = isset($info['janus']) && $info['janus'] === 'server_info';
echo json_encode([
'ok' => true,
'sfu' => [
'enabled' => true,
'status' => $online ? 'online' : 'unreachable',
'janus_version' => $info['version_string'] ?? null,
'janus_url' => sfuConfig('janus_url', 'http://10.7.16.237:8088/janus'),
'signaling_url' => sfuConfig('signaling_url', 'wss://apps.f0xx.org/app/androidcast_project/sfu/ws'),
'ws_url' => '/app/androidcast_project/sfu/ws',
'api_base' => '/app/androidcast_project/sfu/api',
],
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);