Streaming on Your Private Network
The preceding section describes how to broadcast music on and to the computer you’re sitting at. We extend that process in this section to encompass your private network. You create a jukebox of sorts that you can listen to from any computer on your LAN.Understanding URLs
Have you ever wondered what the various parts of a URL mean? Using a URL like http:// localhost:8000/track1.ogg to access a streaming audio server , we thought we should dissect what the various parts mean and do. This list describes the function of each URL element:
Protocol: Icecast2 uses HyperText Trans-port Protocol — HTTP — packets to encapsulate audio streams. HTTP is a good choice because it’s easy to configure your firewalls to allow HTTP connections.
Address: The Icecast2 server’s IP address. The address can either be a domain name or in numeric form. For example, you could replace localhost with its numeric address, 127.0.0.1.
Port: The port number Icecast2 uses to listen for TCP connection requests. Icecast2 uses port 8000 by default; you can easily change the port by modifying the Icecast2 configuration file.
MountPoint: This component specifies the Icecast2 stream to which to connect. Icecast2 is capable of playing two streams. In this example, you use the content file track1.ogg, which you may have created in the preceding section.
These steps describe how to configure your Icecast2 server to broadcast over your private network.
Log in as root and open the Gedit text editor by clicking the GNOME Menu and choosing AccessoriesText Editor.
In the Gedit window, choose FileOpen.
Select /usr/local/etc/icecast.xml and click OK.
Change the loopback address, 127.0.0.1 — the IP address of your Icecast2 server. For example, if your server’s IP address is 192.168.1.1, modify the file as shown here; change the host name as appropriate too:
<hostname>veracruz</hostname>
<port>8000</port>
<bind-address>192.168.1.1</bind-address>
<master-server>192.168.1.1</master-server>
Note that the port number doesn’t change.
Change the passwords from their default values. Otherwise, anyone who downloads the Icecast2 package can determine your password:
<source-password>givememusic</source-password>
<relay-password>givememusic</relay-password>
Modify the e-mail and location information to match your network.
That gives any listeners an idea of who you are and where you’re coming from.
<location>Hi-Fi Paunchy</location>
<admin>oldgomez@paunchy.net</admin>
Save your changes by clicking the Save button and open the /usr/ local/etc/ices-playlist.xml file in Gedit.
Modify the file so that Ices2 contacts the Icecast2 server:
<hostname>veracruz</hostname>
<port>8000</port>
<password>givememusic</password>
<mount>/track1.ogg</mount>
Save your changes and close the Gedit window.
Open a GNOME Terminal window and start the server:
killall –9 icecast ices
icecast –c /usr/local/etc/icecast.xml &
ices /usr/local/etc/ices-playlist.xml &
Enter this command to start XMMS and connect to the newly configured Icecast2 stream:
xmms http://192.168.1.1:8000/track1.ogg
You can also use MPlayer to listen to the stream, if you want:
mplayer http://192.168.1.1:8000/track1.ogg