European Open Root Server Network

Music Streaming for the Poor

Ever wanted to stream a song (or a movie...) to another computer with basic tools, in just a second, without having to share data and on the commandline? Here you go:

Client side

Install mplayer and nc (netcat). Invoke the following command:

nc -l -p 1777 | mplayer  -noconsolecontrols -

nc will now listen on all your interfaces on port 1777 and pipe any input to mplayer.

Server side

Send any (media) files (or mplayer exploits ;-) to the client IP, port1777:

cat my-lame-music/best-of-singing-dude/* | nc <client-ip> 1777

Both sides can abort the stream by issueing ^C.

That rocks, I want more!

Configure (x)inetd on the client to start mplayer for you:

cat /etc/xinetd.d/mplayer  
service mplayer
	socket_type     = stream
	protocol        = tcp
	port            = 1777
	wait            = no
	user            = cal
	server          = /usr/bin/mplayer
	server_args     = -noconsolecontrols -
	disable         = no


The examples above take absolutely no care about security and leaves mplayer open to the world. Adjust the settings of nc and (x)inetd to reflect your network, needs and the risk you want to take.