Repository navigation
Discovery
This article explains part of Radio 2.0 in plain words. It is not normative: where it differs from the specification, the specification is right.
Discovery is how a player or directory finds a station's manifest when it starts from only a stream URL or a homepage. A station offers one to three standard routes, and a consumer tries them in a fixed order. Discovery confers no trust; every manifest is then checked under the rules in Verification and ownership.
| Defined in | Specification section 3 |
| Well-known path |
/.well-known/radio-manifest.json on the homepage host |
| HTML link | <link rel="alternate" type="application/radio-manifest+json" href="..."> |
| HTTP header | Link: <manifestUrl>; rel="radio-manifest"; type="application/radio-manifest+json" |
| Fallback |
icy-url header, as a homepage |
| Status | Draft; the names are provisional (see Open questions) |
Without discovery a player holding only an old stream URL could not find the manifest, and link rot would not be solved. With it, a stream already listed in an old directory can lead back to the station.
A publisher must offer at least one and should offer all its hosting allows.
-
Well-known address.
GET https://<homepage host>/.well-known/radio-manifest.jsonanswers the manifest, or redirects to it with 301, 302, 307 or 308. -
HTML link. The homepage carries the
<link rel="alternate">shown above in its<head>, withhrefset to themanifestUrl. -
HTTP
Linkheader on every stream response, includingHEADrequests and HLS playlists. A relative reference resolves against the stream URL (RFC 8288).
A consumer with a stream URL should look for the Link header first. It should send HEAD. If that fails or carries no Link, it should send one GET with Range: bytes=0-0 and Icy-Metadata: 0, read only the response headers, and close the connection, because live streams often ignore Range. A publisher must send the Link header on both requests.
If there is no Link and the stream sends an icy-url header with an http or https URL, the consumer may take that URL as a homepage and continue from there. See ICY metadata and existing streams.
A consumer with a homepage should read the HTML link and then try the well-known address. When the two disagree, the HTML link wins. If the linked manifest cannot be used (network failure, a status other than 200, or a document that does not parse), the consumer should try the well-known address next.
It must not try the well-known address after a refusal under the network limits of Caching and security or after a guid mismatch (see Verification and ownership). Both end discovery.
<link rel="alternate" type="application/radio-manifest+json"
href="https://radio.example.org/.well-known/radio-manifest.json">(The attribute values are the form given in the specification; the host is a placeholder.)
Fetching follows the section 10.2 limits: at most 5 redirects, 256 KiB, 10 seconds, no downgrade to http, and development addresses refused unless configured.
- Serving the well-known path for more than one station on a shared origin. The spec forbids it.
- Sending
LinkonGETbut not onHEAD. - Treating a discovered manifest as trusted without checking the origin rule.
Radio 2.0 is an open standard, MIT licensed. Documentation: radio2.org. Questions: Discussions.
Overview
The manifest
Discovery and identity
Live data
Money
Implementations and tools
- Implementations
- Reference implementation
- radio2 command line tool
- Create a manifest
- Conformance
- Stations
- Brand and badges
Project
Documentation
Community