/health
JSON EndpointRocket Streaming Audio Server provides a simple JSON endpoint that provides a basic listener count on each mount, and can be used as a health check for loadbalancers.
This endpoint is available at /health
.
An example response is:
{
"last_config_reload": 1630092595,
"mounts": {
"/main": {
"format": {
"bitrate": 128,
"channels": 2,
"content_type": "audio/mpeg",
"codec": "MP3",
"samplerate": 44100
},
"listener_count": 37,
"metadata": {
"now_playing": "Artist - Title"
}
},
"/alt": {
"format": {
"bitrate": 128,
"channels": 2,
"content_type": "audio/aac",
"codec": "AAC-LC",
"samplerate": 44100
},
"listener_count": 30,
"metadata": {
"now_playing": "Some alt band - Example song"
}
},
"/jazz": {
"format": {
"bitrate": 128,
"channels": 2,
"content_type": "audio/mpeg",
"codec": "MP3",
"samplerate": 44100
},
"listener_count": 160,
"metadata": {
"now_playing": "Jazz band - Grooving"
}
},
"/rock": {
"format": {
"bitrate": 256,
"channels": 2,
"content_type": "application/ogg",
"codec": "Opus",
"samplerate": 44100
},
"listener_count": 368,
"metadata": {
"now_playing": "Some rock band - Some rock song"
}
}
},
"total_listener_count": 595,
"total_source_count": 4
}
The /health
endpoint can be password protected by specifying a <health-password>
in the <authentication>
section of your config file:
<authentication>
<health-password>changeme</health-password>
</authentication>
/health
Each mount also has its own health endpoint, at /<mount>/health
, for querying details of a particular stream.
These can be individually password protected by specifying a <health-password>
inside the <mount>
config:
<mount>
<mount-name>/radio</mount-name>
...
<health-password>changeme</health-password>
</mount>
Because the access.log
and playlist.log
formats used by RSAS are the same
as those used by Icecast, RSAS should be compatible with any Icecast statistics
software that generates aggregated statistics by processing those log files.
For more information about these logs, see Logging.
RSAS has an optional status page which mimics a legacy Icecast2 status page. Enabling this status page will also
enable /status-json.xsl
as a JSON endpoint, which mimics Icecast2 as well.
This status page and JSON endpoint are used by some third-party player widgets and services to obtain the "Now Playing" metadata for a stream. Enabling this will improve compatibility with these widgets and services.
To enable the Icecast-compatible status page on Linux, add the following to your config file:
<emulation>
<icecast-status-page>1</icecast-status-page>
</emulation>
For a complete example, see the "Kitchen Sink" example configuration file.
On Windows, it can be enabled in the Configuration screen, by checking "Enable Icecast-compatible status page" and restarting RSAS.
The Icecast Admin interface is not currently implemented. Some of the statistics fields in /status-json.xsl
are not implemented
and return default values, but enough are present for most use cases.