mirror of
git://f0xx.org/ac/ac-ms-sfu-signaling
synced 2026-07-29 04:18:07 +03:00
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:
28
public/index.php
Normal file
28
public/index.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
require_once dirname(__DIR__) . '/src/bootstrap.php';
|
||||
|
||||
/* ── Simple front-controller ─────────────────────────────────────── */
|
||||
$uri = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH);
|
||||
$script = basename($uri);
|
||||
|
||||
/* Strip project prefix /app/androidcast_project/sfu */
|
||||
$uri = preg_replace('#^/app/androidcast_project/sfu#', '', $uri);
|
||||
|
||||
$routes = [
|
||||
'/' => 'dashboard.php',
|
||||
'/health' => 'health.php',
|
||||
'/health.php' => 'health.php',
|
||||
'/api/rooms' => 'api/rooms.php',
|
||||
'/api/join' => 'api/join.php',
|
||||
'/api/stats' => 'api/stats.php',
|
||||
];
|
||||
|
||||
$target = $routes[$uri] ?? null;
|
||||
if ($target && is_file(__DIR__ . '/' . $target)) {
|
||||
require __DIR__ . '/' . $target;
|
||||
exit;
|
||||
}
|
||||
http_response_code(404);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(['ok' => false, 'error' => 'not found']);
|
||||
Reference in New Issue
Block a user