### Connect Listener Client to Icecast Source: https://context7.com/xiph/icecast-server/llms.txt Shows how listeners can connect to Icecast streams via HTTP GET requests using tools like curl and by embedding streams in HTML5 audio players. Includes examples for direct connection, authenticated access, and playlist generation. ```bash # Direct HTTP stream connection curl -o - "http://localhost:8000/live.ogg" | ogg123 - # With authentication curl -u listener:password "http://localhost:8000/live.ogg" | ogg123 - # Generate M3U playlist curl -u admin:adminpass \ "http://localhost:8000/admin/buildm3u?mount=/live.ogg&username=listener&password=pass" \ -o playlist.m3u # HTML5 audio player ``` -------------------------------- ### Get Server Version Information Source: https://context7.com/xiph/icecast-server/llms.txt Retrieves detailed information about the Icecast server version and build. ```bash curl -u admin:adminpass \ "http://localhost:8000/admin/version" ``` -------------------------------- ### Example POST Data for Authentication Events Source: https://github.com/xiph/icecast-server/blob/master/doc/auth/index.html This snippet shows the format of the POST data sent by Icecast to the configured authentication scripts for mount lifecycle events. ```text action=mount_add&mount=/live&server=icecast.example.org&port=8000 action=mount_remove&mount=/live&server=icecast.example.org&port=8000 ``` -------------------------------- ### Define Mountpoint Alias Source: https://github.com/xiph/icecast-server/blob/master/doc/config_file/index.html Example of how to create a mountpoint alias in the Icecast configuration file to map a source path to a destination path. ```xml ``` -------------------------------- ### GET /admin/listclients Source: https://context7.com/xiph/icecast-server/llms.txt Retrieves detailed information about all listeners connected to a specific mount point. ```APIDOC ## GET /admin/listclients ### Description Retrieves detailed information about all listeners connected to a specific mount point. ### Method GET ### Endpoint /admin/listclients ### Parameters #### Query Parameters - **mount** (string) - Required - The mount point path (e.g., /live.ogg) to query. ### Request Example curl -u admin:password "http://localhost:8000/admin/listclients?mount=/live.ogg" ### Response #### Success Response (200) - **listeners** (array) - List of connected client objects with IP and connection duration. ``` -------------------------------- ### Example POST request body for stream_auth Source: https://github.com/xiph/icecast-server/blob/master/doc/auth/index.html This snippet demonstrates the format of the POST body sent to the Icecast server during a stream authentication request. It includes parameters for the mount point, client IP, server address, port, credentials, and administrative status. ```text action=stream_auth&mount=/stream.ogg&ip=192.0.2.0&server=icecast.example.org&port=8000&user=source&pass=password&admin=1 ``` -------------------------------- ### GET /admin/listmounts Source: https://context7.com/xiph/icecast-server/llms.txt Lists all currently active stream mount points on the server. ```APIDOC ## GET /admin/listmounts ### Description Returns a list of all currently active stream mount points. ### Method GET ### Endpoint /admin/listmounts.json ### Parameters None ### Request Example curl -u admin:password "http://localhost:8000/admin/listmounts.json" ### Response #### Success Response (200) - **mounts** (array) - List of active mount point paths. #### Response Example { "mounts": ["/live.ogg", "/backup.mp3"] } ``` -------------------------------- ### Get Listener Information (JSON) Source: https://context7.com/xiph/icecast-server/llms.txt Retrieves a list of current listeners for a specific mount point in JSON format. The response includes details such as IP addresses, user agents, connection duration, TLS status, and GeoIP data. ```bash curl -u admin:adminpass \ "http://localhost:8000/admin/listclients.json?mount=/live.ogg" ``` -------------------------------- ### Admin API - Server Management Source: https://context7.com/xiph/icecast-server/llms.txt Endpoints for managing server operations like reloading configuration, getting status, and version information. ```APIDOC ## POST /admin/reloadconfig ## POST /admin/reloadconfig.json ### Description Triggers a configuration file reload without restarting the server. ### Method POST ### Endpoint `/admin/reloadconfig` or `/admin/reloadconfig.json` ### Request Example ```bash # Queue a config reload curl -X POST -u admin:adminpass "http://localhost:8000/admin/reloadconfig" # JSON response format curl -X POST -u admin:adminpass "http://localhost:8000/admin/reloadconfig.json" ``` ### Response Example (Typically a success status or empty response on success. `.json` endpoint may return JSON status.) ``` ```APIDOC ## GET /admin/dashboard ## GET /admin/dashboard.json ### Description Retrieves a health status dashboard with warnings and server diagnostics. ### Method GET ### Endpoint `/admin/dashboard` or `/admin/dashboard.json` ### Request Example ```bash # Get dashboard status curl -u admin:adminpass "http://localhost:8000/admin/dashboard" # JSON format curl -u admin:adminpass "http://localhost:8000/admin/dashboard.json" ``` ### Response Example (Returns dashboard status information. `.json` endpoint returns data in JSON format.) ``` ```APIDOC ## GET /admin/version ### Description Gets detailed server version and build information. ### Method GET ### Endpoint `/admin/version` ### Response Example ``` Icecast 2.4.4 ``` ``` -------------------------------- ### GET /admin/stats Source: https://context7.com/xiph/icecast-server/llms.txt Retrieves comprehensive server statistics including global metrics and per-mount information. ```APIDOC ## GET /admin/stats ### Description Retrieves comprehensive statistics about the server including global metrics and per-mount information. ### Method GET ### Endpoint /admin/stats.json ### Parameters #### Query Parameters - **show-listeners** (integer) - Optional - Set to 1 to include detailed listener information in the response. ### Request Example curl -u admin:password "http://localhost:8000/admin/stats.json" ### Response #### Success Response (200) - **icestats** (object) - Root object containing server metadata and source array. #### Response Example { "icestats": { "admin": "admin@example.org", "host": "stream.example.org", "server_id": "Icecast 2.5.0", "clients": 42, "source": [ { "mount": "/live.ogg", "listeners": 35 } ] } } ``` -------------------------------- ### Get Listeners Source: https://context7.com/xiph/icecast-server/llms.txt Retrieves a list of current listeners for a specific mount point in JSON format. The response includes details such as IP addresses, user agents, connection duration, TLS status, and GeoIP data. ```APIDOC ## GET /admin/listclients.json ### Description Retrieves a list of current listeners for a specific mount point in JSON format. ### Method GET ### Endpoint `/admin/listclients.json?mount=` ### Query Parameters - **mount** (string) - Required - The mount point of the stream to get listener information for. ### Response Example ```json { "listeners": [ { "ip": "192.168.1.100", "useragent": "Mozilla/5.0", "connected_at": "2023-10-27T10:00:00Z", "duration": 3600, "tls": false, "geoip": { "country": "US", "city": "New York" } } ] } ``` ``` -------------------------------- ### Configure Fallback Mount Point Source: https://context7.com/xiph/icecast-server/llms.txt Sets or retrieves the fallback mount point for a stream. Listeners are redirected to the fallback mount when the primary source disconnects. This operation can be used to get the current configuration or set a new one. ```bash # Get current fallback configuration curl -u admin:adminpass \ "http://localhost:8000/admin/fallbacks?mount=/live.ogg" ``` ```bash # Set a new fallback mount curl -X POST -u admin:adminpass \ "http://localhost:8000/admin/fallbacks?mount=/live.ogg&fallback=/backup.ogg" ``` -------------------------------- ### Connect Source Client to Icecast Source: https://context7.com/xiph/icecast-server/llms.txt Demonstrates connecting source clients to an Icecast server using various tools like ffmpeg, liquidsoap, ices, and ezstream to stream audio content. ```bash # Stream using ffmpeg to Icecast (Ogg Vorbis) ffmpeg -re -i input.mp3 \ -acodec libvorbis -b:a 128k -content_type application/ogg \ -ice_name "My Stream" -ice_description "Test stream" -ice_genre "Rock" \ "icecast://source:sourcepass@localhost:8000/live.ogg" # Stream using liquidsoap liquidsoap 'output.icecast( %vorbis(quality=0.5), host="localhost", port=8000, password="sourcepass", mount="/live.ogg", name="My Radio", mksafe(playlist("/path/to/music")) )' # Stream using ices (Ogg source client) ices -c /etc/ices/ices.xml # Stream MP3 using ezstream ezstream -c /etc/ezstream/ezstream.xml ``` -------------------------------- ### GET /admin/eventfeed Source: https://context7.com/xiph/icecast-server/llms.txt Subscribes to server-sent events for real-time monitoring of stream connections and disconnections. ```APIDOC ## GET /admin/eventfeed ### Description Connects to the server-sent events (SSE) endpoint to receive real-time notifications regarding source connections and disconnections. ### Method GET ### Endpoint /admin/eventfeed ### Parameters #### Query Parameters - **None** ### Request Example curl -N -u admin:password "http://localhost:8000/admin/eventfeed" ### Response #### Success Response (200) - **Content-Type** (text/event-stream) - Stream of JSON events #### Response Example {"event": "source-connect", "data": "/live.ogg"} ``` -------------------------------- ### Set Up Source Authentication in Icecast Source: https://github.com/xiph/icecast-server/blob/master/doc/config_file/index.html Configure listener or source authentication for a mount point. Supports file-based (htpasswd) and URL-based authentication forwarding. A configured authenticator displays a red key icon. ```xml ``` -------------------------------- ### Configure Icecast Mount Points with Authentication Source: https://context7.com/xiph/icecast-server/llms.txt Defines mount points with custom settings, authentication for source and listeners, and event bindings for stream start/stop actions. It also includes default settings for all mounts. ```xml /live.ogg 500 65536 /fallback.ogg true false true /var/archive/live-%Y%m%d-%H%M%S.ogg
false 7200 ``` -------------------------------- ### Configure Path Settings in Icecast Source: https://github.com/xiph/icecast-server/blob/master/doc/config_file/index.html Define various directory and file paths used by Icecast, including base directory, log directory, PID file, web root, admin root, and IP allow/deny lists. Paths should generally not end with a '/'. ```xml ./ ./logs ./icecast.pid ./web ./admin /path/to/ip_allowlist /path_to_ip_denylist /path/to/certificate.pem ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS /path/to/mime.types ``` -------------------------------- ### GET /status-json.xsl Source: https://github.com/xiph/icecast-server/blob/master/doc/server_stats/index.html Retrieves the current server statistics in JSON format. This endpoint provides a stable interface for monitoring server and stream-specific metrics. ```APIDOC ## GET /status-json.xsl ### Description Retrieves the current server statistics, including global server metrics and per-mount source information, in JSON format. ### Method GET ### Endpoint /status-json.xsl ### Parameters None ### Request Example GET /status-json.xsl ### Response #### Success Response (200) - **icestats** (object) - The root object containing server statistics. - **icestats.admin** (string) - Administrator email address. - **icestats.clients** (integer) - Current number of connected clients. - **icestats.sources** (integer) - Number of active sources. #### Response Example { "icestats": { "admin": "icemaster@localhost", "clients": 2, "sources": 2, "source": [ { "mount": "/audio.ogg", "title": "All that she wants", "listeners": 0 } ] } } ``` -------------------------------- ### Configure Icecast Stream Relays Source: https://context7.com/xiph/icecast-server/llms.txt Sets up relaying from upstream Icecast or Shoutcast servers, supporting simple relays, failover with multiple upstream servers, and master-slave configurations. ```xml /relayed.ogg false http://upstream.example.org:8000/source.ogg /redundant.ogg true master1.example.org master2.example.org 8000 /source.ogg master.example.org 8000 120 relaypass true ``` -------------------------------- ### Get Server Dashboard Status Source: https://context7.com/xiph/icecast-server/llms.txt Retrieves a health status dashboard for the Icecast server, including warnings and diagnostics. The status can be requested in plain text or JSON format. ```bash # Get dashboard status curl -u admin:adminpass \ "http://localhost:8000/admin/dashboard" ``` ```bash # JSON format curl -u admin:adminpass \ "http://localhost:8000/admin/dashboard.json" ``` -------------------------------- ### Kill Source Connection Source: https://context7.com/xiph/icecast-server/llms.txt Terminates a source connection for a specified mount point. This action stops the stream. A POST request is required in strict mode; a legacy GET request is also supported but deprecated. ```bash # Kill a source (requires POST in strict mode) curl -X POST -u admin:adminpass \ "http://localhost:8000/admin/killsource?mount=/live.ogg" ``` ```bash # Legacy GET request (deprecated) curl -u admin:adminpass \ "http://localhost:8000/admin/killsource?mount=/live.ogg" ``` -------------------------------- ### Admin API - Source Control - Move Clients Source: https://context7.com/xiph/icecast-server/llms.txt Moves listeners from one mount point to another, useful for stream transitions or managing listener distribution. ```APIDOC ## POST /admin/moveclients ### Description Moves listeners from one mount point to another. ### Method POST ### Endpoint `/admin/moveclients?mount=&destination=[&id=]` ### Query Parameters - **mount** (string) - Required - The current mount point of the listeners. - **destination** (string) - Required - The mount point to move the listeners to. - **id** (string) - Optional - The connection ID of a specific listener to move. If omitted, all listeners from the source mount are moved. ### Request Example ```bash # Move all listeners curl -X POST -u admin:adminpass "http://localhost:8000/admin/moveclients?mount=/old-stream.ogg&destination=/new-stream.ogg" # Move a specific listener curl -X POST -u admin:adminpass "http://localhost:8000/admin/moveclients?mount=/old.ogg&destination=/new.ogg&id=12345" ``` ### Response Example (No specific response body detailed, typically a success status or empty response on success.) ``` -------------------------------- ### Move Clients Between Mount Points Source: https://context7.com/xiph/icecast-server/llms.txt Moves listeners from one mount point to another. This is useful for stream transitions or load balancing. It can move all clients or a specific client by ID. ```bash # Move all listeners to a different mount curl -X POST -u admin:adminpass \ "http://localhost:8000/admin/moveclients?mount=/old-stream.ogg&destination=/new-stream.ogg" ``` ```bash # Move a specific listener curl -X POST -u admin:adminpass \ "http://localhost:8000/admin/moveclients?mount=/old.ogg&destination=/new.ogg&id=12345" ``` -------------------------------- ### Configure Mount Point Settings in Icecast Source: https://github.com/xiph/icecast-server/blob/master/doc/config_file/index.html Specifies settings for a particular mount point, overriding global defaults. Includes options like mount name, authentication credentials, listener limits, stream metadata, and fallback configurations. Most changes apply on configuration re-read or stream start/end. ```xml /example-complex.ogg othersource hackmemore 1 3600 /tmp/dump-example1.ogg /intro.ogg /example2.ogg 1 1 ISO-8859-1 1 My audio stream My audio description http://some.place.com classical 64 application/ogg vorbis 1 65536 4096 /home/icecast/bin/source-start /home/icecast/bin/source-end ``` -------------------------------- ### Admin API - Fallback Configuration Source: https://context7.com/xiph/icecast-server/llms.txt Endpoints for configuring fallback mount points for streams. ```APIDOC ## GET /admin/fallbacks ## POST /admin/fallbacks ### Description Sets or displays the fallback mount point for a stream. ### Method GET (to retrieve) or POST (to set) ### Endpoint `/admin/fallbacks?mount=[&fallback=]` ### Query Parameters - **mount** (string) - Required - The mount point to configure. - **fallback** (string) - Optional (for POST) - The mount point to set as the fallback. ### Request Example ```bash # Get current fallback configuration curl -u admin:adminpass "http://localhost:8000/admin/fallbacks?mount=/live.ogg" # Set a new fallback mount curl -X POST -u admin:adminpass "http://localhost:8000/admin/fallbacks?mount=/live.ogg&fallback=/backup.ogg" ``` ### Response Example (For GET, returns current fallback configuration. For POST, typically a success status or empty response on success.) ``` -------------------------------- ### Admin Functions (General) Source: https://github.com/xiph/icecast-server/blob/master/doc/admin_interface/index.html These functions apply to the entire Icecast server and do not require a specific mountpoint. They provide access to server-wide statistics and configuration. ```APIDOC ## Stats ### Description Retrieves the internal statistics kept by the Icecast server, including mountpoint information, request counts, and listener counts. ### Method GET ### Endpoint /admin/stats ### Request Example ``` /admin/stats ``` ## List Mounts ### Description Lists all currently active mountpoints on the Icecast server. ### Method GET ### Endpoint /admin/listmounts ### Request Example ``` /admin/listmounts ``` ``` -------------------------------- ### Configure Icecast Security Settings Source: https://github.com/xiph/icecast-server/blob/master/doc/config_file/index.html Configures process security, including chroot jail settings and the user/group ownership for the Icecast process to allow binding to privileged ports. ```xml 0 nobody nogroup ``` -------------------------------- ### Retrieve Icecast Server Statistics Source: https://context7.com/xiph/icecast-server/llms.txt Use the admin API to fetch server metrics. Requests can be formatted as XML or JSON, and may include sensitive listener details if authenticated. ```bash curl -u admin:adminpass "http://localhost:8000/admin/stats" curl -u admin:adminpass "http://localhost:8000/admin/stats.json" curl "http://localhost:8000/admin/publicstats.json" ``` -------------------------------- ### Manage Icecast Stream Mounts Source: https://context7.com/xiph/icecast-server/llms.txt Administrative commands to list active mount points and connected listeners. These endpoints require authentication and support multiple output formats for script integration. ```bash curl -u admin:adminpass "http://localhost:8000/admin/listmounts.json" curl -u admin:adminpass "http://localhost:8000/admin/listclients?mount=/live.ogg" ``` -------------------------------- ### Execute Scripts on Source Connect/Disconnect in Icecast Source: https://github.com/xiph/icecast-server/blob/master/doc/config_file/index.html Specify programs to run when a stream source connects or disconnects. The program receives the mountpoint name as a parameter. Note: Not available on Win32 and potential file descriptor issues exist. ```xml /usr/local/bin/on_connect_script.sh /usr/local/bin/on_disconnect_script.sh ``` -------------------------------- ### Configure YP Directory Registration Source: https://context7.com/xiph/icecast-server/llms.txt Configures Icecast to register streams with public directories and defines metadata for individual mount points. This is done via the server configuration XML file. ```xml /public-stream.ogg true My Public Radio 24/7 Music Stream http://myradio.example.org Electronic 128 application/ogg ``` -------------------------------- ### Configure Icecast Server via icecast.xml Source: https://context7.com/xiph/icecast-server/llms.txt The icecast.xml file defines server identity, resource limits, authentication, network sockets, and logging paths. It is the primary configuration mechanism for managing server behavior and security. ```xml Earth admin@example.org stream.example.org 100 2 524288 sourcepass admin adminpass 8000 0.0.0.0 ``` -------------------------------- ### Configure Icecast Directory Publishing Settings Source: https://github.com/xiph/icecast-server/blob/master/doc/config_file/index.html Sets the URL and timeout for Icecast to communicate with directory servers for stream listing. The yp-url-timeout specifies the maximum wait time for a response, and yp-url is the directory server's endpoint. ```xml 15 http://dir.xiph.org/cgi-bin/yp-cgi ``` -------------------------------- ### User Authentication for Mountpoints Source: https://github.com/xiph/icecast-server/blob/master/doc/auth/index.html This section describes how to manage users for a specific mountpoint, allowing for the addition and deletion of users with unique usernames and any password. ```APIDOC ## User Authentication Management ### Description Manage users for a specific mountpoint. Users can be added by providing a username and password, and deleted via a link. ### Endpoint (Implicitly managed via Icecast configuration or web interface, not a direct API endpoint in this context) ### Parameters - **Username** (string) - Required - Unique username for authentication. - **Password** (string) - Required - Password for the user. No restrictions apply. ### Request Example (Configuration details, not a direct request) ``` /your_mount.ogg ``` ### Response (Management actions typically reflected in the Icecast configuration or status.) ``` -------------------------------- ### Configure URL Authentication in Icecast XML Source: https://github.com/xiph/icecast-server/blob/master/doc/auth/index.html This XML snippet demonstrates how to define URL-based authentication within an Icecast mount configuration. It includes various endpoints for mount and listener events, as well as custom header configurations. ```xml /example.ogg ``` -------------------------------- ### Configure Icecast TCP Listen Sockets Source: https://github.com/xiph/icecast-server/blob/master/doc/config_file/index.html Defines network listening sockets for the Icecast server. This includes specifying the port, an optional bind address for specific network interfaces, and enabling TLS/SSL for secure connections. It also supports configuring Shoutcast compatible ports. ```xml 8000 127.0.0.1 8443 1 8004 /live.mp3 ``` -------------------------------- ### Icecast Relay Configuration Source: https://github.com/xiph/icecast-server/blob/master/doc/relaying/index.html Configuration settings for an Icecast server acting as a relay (slave server) to a master server. ```APIDOC ## Icecast Relay Configuration ### Description This section details the configuration options for setting up an Icecast server to relay streams from a master server. The slave server connects to the master and relays a specified mountpoint, with options to override local mountpoint names, handle Shoutcast streams, and manage on-demand streaming. ### Configuration Options - **server** (string): The hostname or IP address of the master server containing the mountpoint to be relayed. - **port** (integer): The TCP port of the master server. - **mount** (string): The mountpoint on the remote master server. For Shoutcast streams, this must be `/`. - **local-mount** (string, optional): The name for the local mountpoint on the relaying server. Defaults to the remote mountpoint. - **username** (string, optional): The username, if required, for accessing the remote mountpoint. - **password** (string, optional): The password, if required, for accessing the remote mountpoint. - **relay-shoutcast-metadata** (integer, optional): Set to `1` to relay Shoutcast metadata (song titles). Defaults to enabled if the remote server sends metadata. Possible values: `1` (enabled), `0` (disabled). - **on-demand** (integer, optional): Set to `1` to enable on-demand relaying, where the stream is only retrieved if listeners are connected. Defaults to the value of ``. Possible values: `1` (enabled), `0` (disabled). ### Example Configuration Snippet ```xml 192.168.1.11 8001 /example.ogg /relayed.ogg relay_user relay_password 1 1 ``` ### Notes - When relaying a Shoutcast stream, the `` must be specified as `/`. - If `` is set to `1`, Shoutcast metadata is embedded within the stream. - The master server is unaware of the relaying being performed. ``` -------------------------------- ### Admin API - Logging Source: https://context7.com/xiph/icecast-server/llms.txt Endpoints for viewing server logs and inserting markers for debugging. ```APIDOC ## GET /admin/showlog ### Description Retrieves recent log entries from server log files. ### Method GET ### Endpoint `/admin/showlog?logfile=` ### Query Parameters - **logfile** (string) - Required - The name of the log file to view (e.g., `error`, `access`, `playlist`). ### Request Example ```bash # View error log curl -u admin:adminpass "http://localhost:8000/admin/showlog?logfile=error" # View access log curl -u admin:adminpass "http://localhost:8000/admin/showlog?logfile=access" ``` ### Response Example (Returns the content of the specified log file.) ``` ```APIDOC ## POST /admin/marklog ### Description Inserts a marker in all log files, useful for debugging and correlating events. ### Method POST ### Endpoint `/admin/marklog` ### Request Example ```bash curl -X POST -u admin:adminpass "http://localhost:8000/admin/marklog" ``` ### Response Example (No specific response body detailed, typically a success status or empty response on success.) ```