So did you rip your entire music collection and encode it in MP3, OGG, WMA,
etc? Is all that music just sitting on your hard drive at home? Can’t afford
or don’t want to spend the money on a portable player with a really large hard
drive? Got a broadband connect to the Internet?

Here I present a solution where you can listen to your music collection from
anywhere on the Internet. Your home computer can be running BSD, Linux, or
Windows and can be behind a firewall running NAT. Depending on you home
network configuration, the computer you’ll be listening to your music from must
at least have a web browser and media player capable of handling .m3u playlists
and music streams.

I have a cable Internet connection with a firewall running NAT and a PC
that dual boots between FreeBSD and Windows XP. I use
gnump3d for the streaming music
server. It is written in Perl so it runs on any of the UNIX based
operating systems and also runs on Windows using either href="http://www.cygwin.com">Cygwin or the href="http://www.activestate.com">ActiveState Perl distribution.

The first thing you need to do is open up a port on your firewall. By
default, gnump3d runs on port 8888 although you can assign it anything you
want. Configure your firewall to map that port to the IP address of your
PC. For my setup I ONLY have port 22 open on my firewall.
All connections I make to my home PC I tunnel through
SSH… more on that later.

Now configure gnump3d. The gnump3d.conf configuration items we are
concerned with here are the port and binding_host. Set the
port to the port number you opened up on your firewall. Assuming
your using NAT, set the binding_host to the public WAN IP address
used by your firewall. The binding_host address is used in the
generated .m3u playlists. You can’t use the private IP address being used
by your PC because it isn’t routable on the Internet. Lastly, configure
your OS to start gnump3d upon startup so it is always available.

Now you should have gnump3d up and running. Point a web browser to:

http://<FirewallWanIpAddress>:8888

You should see a page generated by gnump3d showing a bunch of links to your
music collection. Browse around and click on a music file. This will
cause gnump3d to create a .m3u file which your local media player will read
and play the song. Pretty much all decent media players are able to
understand .m3u playlist files. I highly recommand
foobar2000 or
Winamp for Windows and

XMMS for UNIX. There you go. You should
know be able to access your music collection from anywhere on the Internet.

If your a security freak like me then you’ll want to tunnel your gnump3d
connections though SSH. This is really simple. First open up port 22 on
your firewall and point it to your home PC. Configure the sshd server to
run on your home PC and make sure it is initialized during startup so it is
always available. You can find SSH
ports which run on both UNIX and Windows based operating systems. Set the
gnump3d port to anything you like (i.e. 8888 is fine) and set the
binding_host to 127.0.0.1. This is the localhost address which is
only used for local communication within the system.

Now from any computer on the Internet ssh to your home PC using the following
command:

ssh -L 9999:127.0.0.1:8888 <username>@<FirewallWanIpAddress>

This command says create an encrypted connection to
<FirewallWanIpAddress> and forward all traffic from port 9999 on the
local system though the connection to port 8888 on the remote system.
Now point a web browser to:

http://127.0.0.1:9999

You should see a page generated by gnump3d showing a bunch of links to your
music collection. That’s it!

There are other solutions for accessing your home based music collection.
If you already run a web server and database on your home PC then check out
Netjuke. It is much more powerful
than gnump3d but a lot harder to install and configure (i.e. it requires a
web server, mysql, php, etc).

About Eric Davis

I’m a software engineer with an expertise in embedded OS kernels and networking stacks. When I’m not wasting oodles of time hacking on a computer, you can find me either surfing, golfing, lifting weights, or drinking beer at a micro-brewery. I also run foobargeek