A SHOUTcast Server
To finish off this chapter, we’ll use our newly acquired skills in socket programming to write a SHOUTcast server. SHOUTcast is a protocol developed by the folks at Nullsoft for streaming audio data.[18] SHOUTcast sends MP3- or AAC-encoded audio data using HTTP as the transport protocol.
To see how things work, we’ll first look at the SHOUTcast protocol. Then we’ll look at the overall structure of the server. We’ll finish with the code.
The SHOUTcast Protocol
The SHOUTcast protocol is simple.
-
First the client (which can be something like XMMS, Winamp, or iTunes) sends an HTTP request to the SHOUTcast server. Here’s the request that XMMS generates when I run my SHOUTcast server at home:
GET / HTTP/1.1 Host: localhost
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access