Nodeflux Central
Broadcast (Gambar & GPS)

API Reference: Broadcast

Endpoint untuk menyiarkan gambar dan GPS ke channel, memeriksa status channel, dan WebSocket penerima siaran.

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

POST
/api/v1/broadcast/img/{channel}

Path Parameters

channel*string

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

POST
/api/v1/broadcast/gps/{channel}

Path Parameters

channel*string

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

GET
/api/v1/broadcast/status/{channel}

Path Parameters

channel*string

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

GET
/ws/v1/broadcast/receives/{path}

Path Parameters

path*string

Channel path penuh {channel}/{stream_id}.

Response Body

application/json

curl -X GET "http://localhost:9080/ws/v1/broadcast/receives/live/mobile/camera1"
Empty
{  "success": false,  "error": "Not found",  "details": "Resource does not exist"}

On this page