Getting Started
This is a step-by-step guide to setting up a DistribuStream server.
Step One: Install Ruby
Installing Ruby will vary depending on your platform:
- Windows: Grab the Windows Ruby installer
- OS X: Leopard ships with both Ruby and RubyGems. If you’re using an earlier version of OS X, then follow this guide
- Linux/BSD/etc: Ruby is often bundled with Unix-like operating systems. If not, install Ruby through your package manager (e.g. apt-get install ruby, yum install ruby)
Step Two: Install RubyGems
RubyGems is the standard Ruby package manager. It’s similar to apt-get, emerge, and other OS package managers.
(extract, then run “ruby setup.rb”)
If you have any problems getting RubyGems installed, check out the RubyGems User Guide
Step Three: Install DistribuStream
Once you have RubyGems installed, you can use it to download and install DistribuStream and all of its dependencies with a single command:
gem install distribustream —include-dependencies
This will download and install DistribuStream and should hopefully add the server and client programs, dstream and dsclient, to your path.
Step Four: Configure DistribuStream
To begin, download the example DistribuStream configuration file and edit it to your choosing. Be sure to set the host address to bind to and optionally the vhost you wish to identify as.
Next, start the DistribuStream server:
dstream -f—conf myconfig.yml
If everything went well, you should see something similar to the following:
dstream starting. Run 'dstream --help' for more info. status at http://192.168.0.51:6087/status accepting connections on 192.168.0.51:6086 file service running at 192.168.0.51:6087
You can think of the DistribuStream server like a regular web or FTP server. It looks through the specified directory and makes the files underneath it available to the peer-to-peer network.
You can see what’s going on through the web interface, which runs one port above the port you configured the server to listen on. If the server is listening on the default port of 6086, you can reach the web interface at:
http://myserver.url:6087/status
Step Five: Test Your Server
To test your server, use the DistribuStream client:
dsclient pdtp://myserver.url/file.ext
This will download file.ext from your DistribuStream server.
The client also supports non-seekable output such as pipes. To play streaming media as it downloads, you can:
dsclient -o pdtp://myserver.url/file.ext | mediaplayer –
Just replace “mediaplayer” with your favorite media player program, e.g. vlc, mplayer