Control API
The Control API provides endpoints for managing stream keys and controlling static stream relays (push/pull).
Stream Key Management
These endpoints allow you to manage the mapping between public stream names (room
) and secret publisher keys (channelkey
).
Get Stream Key
Retrieves the current channelkey
for a given stream name. If a key doesn't exist, a new one is generated and stored.
- Endpoint:
GET /control/get
- Query Parameters:
room
(string, required): The public name of the stream.
- Success Response:
- Code:
200 OK
- Body: A plain text string containing the
channelkey
.
- Code:
-
Example:
curl "http://localhost:8090/control/get?room=my_stream"
Reset Stream Key
Generates a new, random channelkey
for a stream, invalidating the old one.
- Endpoint:
GET /control/reset
- Query Parameters:
room
(string, required): The public name of the stream.
- Success Response:
- Code:
200 OK
- Body: The new plain text
channelkey
.
- Code:
-
Example:
curl "http://localhost:8090/control/reset?room=my_stream"
Delete Stream Key
Deletes the stream key mapping for a given room.
- Endpoint:
GET /control/delete
- Query Parameters:
room
(string, required): The public name of the stream.
- Success Response:
- Code:
200 OK
- Body:
{"status":200,"data":"Ok"}
- Code:
- Error Response (Not Found):
- Code:
404 Not Found
- Body:
{"status":404,"data":"room not found"}
- Code:
-
Example:
curl "http://localhost:8090/control/delete?room=my_stream"
Static Stream Relaying
These endpoints allow you to programmatically start and stop pulling a remote RTMP stream to your LiveGo server or pushing a local stream to a remote RTMP server.
Pull Remote Stream
Tells LiveGo to connect to a remote RTMP stream and relay it to a local stream.
- Endpoint:
GET /control/pull
- Query Parameters:
oper
(string, required):start
orstop
.app
(string, required): The local application name.name
(string, required): The local stream name.url
(string, required): The remote RTMP URL to pull from.
-
Example (Start):
curl "http://localhost:8090/control/pull?oper=start&app=live&name=remote_stream&url=rtmp://remoteserver/live/stream1"
-
Example (Stop):
curl "http://localhost:8090/control/pull?oper=stop&app=live&name=remote_stream&url=rtmp://remoteserver/live/stream1"
Push Local Stream
Tells LiveGo to push a local stream to a remote RTMP server.
- Endpoint:
GET /control/push
- Query Parameters:
oper
(string, required):start
orstop
.app
(string, required): The local application name.name
(string, required): The local stream name.url
(string, required): The remote RTMP URL to push to.
-
Example (Start):
curl "http://localhost:8090/control/push?oper=start&app=live&name=my_stream&url=rtmp://another-server/ingest/key"
-
Example (Stop):
curl "http://localhost:8090/control/push?oper=stop&app=live&name=my_stream&url=rtmp://another-server/ingest/key"