Skip to content

Instantly share code, notes, and snippets.

@niko
Forked from ePirat/spec.md
Last active February 28, 2026 11:42
Show Gist options
  • Select an option

  • Save niko/2a1d7b2d109ebe7f7ca2f860c3505ef0 to your computer and use it in GitHub Desktop.

Select an option

Save niko/2a1d7b2d109ebe7f7ca2f860c3505ef0 to your computer and use it in GitHub Desktop.
Icecast Protocol specification

Icecast protocol specification

What is the Icecast protocol?

When speaking of the Icecast protocol here, actually it's just the HTTP protocol, and here we will explain futher how source clients need to send data to Icecast.

HTTP PUT based protocol

Since Icecast version 2.4.0 there is support for the standard HTTP PUT method. The mountpoint to which to send the data is specified by the URL path.

Authentication

The authentication is done using HTTP Basic auth. To quickly sum it up how it works: The client needs to send the Authorization header to Icecast, with a value of Basic (for basic authentication) followed by a whitespace and then the username and password separated by a colon : encoded as Base64.

Specifying mountpoint informations

The mountpoint itself is specified as the path part of the URL.
Additional mountpoint information can be set using specific (non-standard) HTTP headers:

ice-public : For a mountpoint that doesn't has <public> configured, this influences if the mountpoint shoult be advertised to a YP directory or not.

@norohind
Copy link

norohind commented Jan 7, 2023

Thanks for code example!

@angrycoding
Copy link

Thank you very much for it :)

Copy link

ghost commented May 8, 2023

Thank you for this!

@MrJake222
Copy link

best!

@vvvin333
Copy link

I think there is an error:

02StreamTitle='A nice song';StreamUrl=''00000       <- padded with 0-bytes<- padded with 0-bytes up to 2*32 bytes of metadata

should be

... 2*16 bytes of metadata

@niko
Copy link
Author

niko commented Oct 31, 2024

I think you're right. I'll correct it.

@vvvin333
Copy link

vvvin333 commented Nov 12, 2024

@niko I have slightly reverse goal: to write streamed data (audio bytes with meta data inserted) in this format for standard audio player (for React Native). https://stackoverflow.com/a/79147248/15080117
Are there any hidden logic I am missing?
In particular, should meta with 0 length (00 byte) be included in the 16-bytes block length or no (in your explanation: we place zero byte and 16k audio just after it)?
And I have some doubts if we should include length-byte into 16n-padded block (see). Even on your sample it looks like there is additional 00 byte in the next row:

00000020  56 69 65 72 20 2d 20 52  65 69 63 68 27 3b 00 00  |Vier - Reich';..|
00000030  00 <---

If so, it would be better to picture the schema in the following way:

02
StreamTitle='A nice song';000000 <--- 16*2 zero-padded meta

@niko
Copy link
Author

niko commented Nov 12, 2024

Thanks for the image. That's also the answer to your question: The length byte has to be included in any case. If it's 0 the next audio block follows right after.

I wish I could include the image here. Where did you find it?

The additional 00 in the next line seems to be part of the audio in that case as StreamTitle='Die Fantastischen Vier - Reich'; is 46 bytes, so only two zero-bytes are needed for padding to fill up to 48 bytes which the 03 length byte indicates.

@vvvin333
Copy link

I wish I could include the image here. Where did you find it?

https://thecodeartist.blogspot.com/2013/02/shoutcast-internet-radio-protocol.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment