API Reference: Broadcast
Endpoint untuk menyiarkan gambar dan GPS ke channel, memeriksa status channel, dan WebSocket penerima siaran.
← Kembali ke Broadcast
Alur perangkat ke penonton, format pesan, dan tips.
Monitoring
WebSocket lain yang disediakan Liodra.
Liodra tidak memiliki otentikasi API sendiri; batasi akses port 9080 di tingkat jaringan atau reverse proxy. Basis URL memakai variabel LIODRA_API_URL (default http://localhost:9080); untuk WebSocket ganti skema menjadi ws:// atau wss://. Semua endpoint di halaman ini memerlukan --broadcast-on (ENABLE_BROADCAST=true), jika tidak menjawab 404.
Pengirim
Siarkan Gambar
Path Parameters
Channel path bertingkat, mis. live, live/mobile, live/drone.
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:9080/api/v1/broadcast/img/live/mobile" \ -F image="string" \ -F stream_id="camera1" \ -F timestamp="2026-09-15T10:30:00Z"{ "ok": true, "message": "Image uploaded and broadcasted successfully"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Siarkan Lokasi GPS
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "http://localhost:9080/api/v1/broadcast/gps/live/mobile" \ -H "Content-Type: application/json" \ -d '{ "lat": "-6.200000", "long": "106.816666", "stream_id": "camera1", "timestamp": "2026-09-15T10:30:00Z" }'{ "ok": true, "message": "GPS data uploaded and broadcasted successfully"}{ "success": false, "error": "Not found", "details": "Resource does not exist"}Status
Status Broadcast
Path Parameters
Prefix channel untuk filter; boleh kosong.
Response Body
application/json
curl -X GET "http://localhost:9080/api/v1/broadcast/status/live/mobile"{ "ok": true, "message": "Service is running", "service": "liodra-broadcast", "status": "running", "data": { "active_streams": 2, "total_clients": 5, "streams": [ { "channel_path": "live/mobile/camera1", "client_count": 3, "created_at": "2026-09-15T10:00:00Z", "last_activity": "2026-09-15T10:30:00Z" }, { "channel_path": "live/mobile/camera2", "client_count": 2, "created_at": "2026-09-15T09:00:00Z", "last_activity": "2026-09-15T10:25:00Z" } ] }}Penerima
WebSocket Terima Siaran
curl -X GET "http://localhost:9080/ws/v1/broadcast/receives/live/mobile/camera1"{ "success": false, "error": "Not found", "details": "Resource does not exist"}Broadcast (Gambar & GPS)
Menyiarkan snapshot gambar dan koordinat GPS dari perangkat bergerak ke banyak penonton lewat WebSocket, tanpa encoder video.
Monitoring & Sistem
Health check, versi, konfigurasi, metrik proses ingest, log per device, proses on-demand, WebSocket real-time, dan dashboard web bawaan.