You are on page 1of 6

Nullsoft SHOUTcast dnas 2.

0 documentation
Last Modified by jkey Thu 5th aug 2010

Introduction
The goal of SHOUTcast dnas 2 is to provide enhanced serving features and access to the new yp2
infrastructure while maintaining as much backward compatibility with the previous sc_serv as
possible. New features include :

Serve multiple streams from a single server instance


Relay multiple streams from a single server instance
Multiplex all server activity through a single IP port.
Shoutcast 2 wire protocol support for sources, relays and clients
Repackaging of Shoutcast 1 and Shoutcast 2 data as appropriate for the connecting client
yp2 infrastructure support

To take advantage of these new features you will also need the following:

1. sc_trans version V2 B38 or higher


2. authorization hashes (register as a broadcaster in the new infrastructure and you will be issued
the necessary hashes) must be configured to use the yp2 infrastructure to take advantage of the
multiplexing and multiple stream support. The original yp interface had no means of
expressing multiple streams from a single port.

The yp2 interface requires an authorization hash for each station you are running. This hash is
valid for all root servers of that station. To get an authorization hash you must register as a
broadcaster on http://www.shoutcast.com.
Running as daemon or service
Install as windows service

sc_serv.exe install <servicename> <username> <password> <conf>

<servicename> - name of service (how it appears in the service control panel)


<username> - user under which to run service (use 0 for system)
<password> - password for user (use 0 for system or no password)
<conf> - FULL PATH to config file

example:

sc_serv.exe install sc_serv 0 0 sc_serv.conf

Note:
There is no good sense of "working directory" when running as a service,
so all paths in the config file and the playlist file should be fully specified.

Uninstall as win32 servce

sc_serv.exe uninstall <servicename>

example:

sc_serv.exe uninstall sc_serv

Run as a daemon under unix

sc_serv daemon <conf>

To run as console app

windows: sc_serv.exe <conf>


unix: sc_serv <conf>

Unix signals

SIGKILL - stops sc_serv


Configuration file options
Note: Options are NOT case sensitive
If an option is labeled as "multi" then it can be used multiple times.
This is specified by adding _# to the end of the option
name (# begins with zero not one). Note that this "multi" system is NOT
hierarchical, and all values beyond the default must be specified for all connections.

LOGGING OPTIONS:

log - should we do any logging Default = 1


logfile - log file name Default = c:\sc_serv.log or /tmp/sc_serv.log
screenlog - 1 =to log to console Default = 1
w3cenable - 1 to enable w3c logging Default = 1
w3clog - name of w3c log file Default = sc_w3c.log
webclientdebug - 1 to activate debug logging for web client connections Default = 0
yp1debug - 1 to activate debug logging for yp connections Default = 0
yp2debug - 1 to activate debug logging for yp2 connections Default = 0
shoutcastsourcedebug - 1 to activate debug logging for shoutcast source connections Default = 0
uvox2sourcedebug - 1 to activate debug logging for shoutcast 2 source connections Default = 0
shoutcast1clientdebug - 1 to activate debug logging for shoutcast streaming clients Default = 0
shoutcast2clientdebug - 1 to activate debug logging for shoutcast 2 streaming clients Default = 0
relayshoutcastdebug - 1 to activate shoutcast relay debug logging Default = 0
relayuvoxdebug - 1 to activate shoutcast 2 relay debug logging Default = 0
relaydebug - 1 to activate common relay code debugging Default = 0
streamdatadebug - 1 to activate common streaming code debugging Default = 0
httpstyledebug - 1 to activate debug logging for http style requests Default = 0
statsdebug - 1 to activate debug logging for statistics Default = 0
microserverdebug -1 to activate common debug logging for server activity Default = 0
threadrunnerdebug - 1 to activate debug logging for thread manager Default = 0

FLASH SECURITY:

This file is used for connections from adobe flash player,example a flash player
like the one used on http://www.shoutcast.com.
More information on crossdomain policy files can be found here:
http://kb2.adobe.com/cps/142/tn_14213.html

flashpolicyfile - name of file that has flash crossdomain policies Default = crossdomain.xml

BUFFERS :

buffertype - 0 = fixed 1 = adaptive Default = 0


fixedbuffersize - buffer size in bytes if buffer is fixed Default = 1024 * 1024
adaptivebuffersize - buffer size in seconds if buffer is adaptive Default = 1
bufferhardlimit - never bigger than this (in bytes) no matter whatDefault = 16777216
METADATA INTERVAL (SHOUTCAST PROTOCOL VERSION 1+ ONLY) :

metainterval - metadata transmission interval in bytes. Default = 8192

CIPHERKEY ( SHOUTCAST PROTOCOL VERSION 2 ONLY ):

uvoxcipherkey - key used to obfuscate initial handshaking with source Default=foobar

NETWORKING:

namelookups - 1 to do reverse DNS look ups on incoming IP addresses Default = 0


portbase - port that clients and sources connect to Default = 8000
autodumpsourcetime - how long before an idle source is dumped (in seconds). Default = 30
maxheaderlinesize - maximum size of an HTTP header line Default = 2048
maxheaderlinecount - max headers lines in HTTP style exchange Default = 100
password - password for broadcaster to connect
adminpassword - administrator password

YP (SHOUTCAST DIRECTORY):

yp2 - 1 to use yp2 protocol Default = 0


ypaddr - address of yp server Default = yp.shoutcast.com
ypport- port of yp server Default = 80
yppath - path to yp2 services on server Default = /yp2
yptimeout - Timeout, in seconds, for yp requests Default = 60
ypmaxretries - Max times a yp request will be retried Default = 10
ypreportinterval - yp reporting must happen at least this fast (in seconds) Default = 300
ypminreportinterval - yp reporting cannot happen faster than this (in seconds) Default = 10
publicserver - Can be used to override "public" flag from source.
Values are:
default - (use flag from source)
always
never
Default = default
BANNING:

banfile - file in which to store banned IP addresses Default = sc_serv.ban


savebanlistonexit - 1 to rewrite banfile on application exit Default = 1

RIP (reserved IP) :

ripfile - file in which to store list of reserved IP addresses Default = sc_serv.rip


saveriplistonexist - 1 to rewrite ripfile on application exit Default = 1
riponly - 1 to only allow connections from reserved IP addresses Default = 0

CLIENT BEHAVIOR:

maxuser - max clients Default = 32


listenertime - max time in minutes a client can listen. 0 means no limit Default = 0
autodumpusers - 1 to disconnect clients if source disconnects Default = 0
srcip - server side binding address for sources
dstip - server side binding address for clients
titleformat - modifies icy-name
urlformat - modifies icy-url

SPECIAL FILE HANDLING:

introfile - file to play when a client first connects


backupfile - file to play if source disconnects
specialfiletmpdir - place to store intro and backup files uploaded by sc_trans Default = /tmp/
maxspecialfilesize - maximum size, in bytes, of backup or intro files Default = 30000000

MISC:

configrewrite - 1 to have sc_serv rewrite the config file on exit Default = 0


songhistory - max song history to preserive Default = 10
cpucount - non-zero overrides cpu count calculated by software. Default = 0
unique - substitution string for file names Default = $
include - include file

RELAYING:

allowrelay - 1 to allow a relay to connect Default = 1


allowpublicrelay - 1 to allow relays to list themselves in yp Default = 1
relayreconnecttime - seconds to reconnect on relay failure Default = 30
maxhttpredirects - max times we can redirect when relaying Default = 5
relayport - legacy, use stream configs instead
relayserver - legacy, use stream configs instead
STREAM CONFIGURATION:

requirestreamconfigs - 1 to requires stream configs for any sources Default = 0

MUTLI:
streamid - ID of stream
streamauthhash - authorization hash for yp2 registration
streampath - path clients use to access stream
streamrelayurl - url of source to relay (if this is a relay)

If you are going to connect multiple sc_trans instances to sc_serv, you must use the Shoutcast2
protocol.
The original Shoutcast protocol had no means of specifying a stream ID. Clients connecting to the
server do not need Shoutcast2 support, since SHOUTcast dnas will repackage the stream data and
metadata for them as appropriate.

stream config example :

This server is providing three different streams for my station, and is


also relaying my friend's station:

streamid_0=2
streamauthhash_0=abcdef
streampath_0=/bitrate/128

streamid_1=3
streamauthhash_1=abcdef
streampath_1=/bitrate/64

streamid_2=4
streamauthhash_2=abcdef
streampath_2=/bitrate/24

streamid_3=5
streamauthhash_3=aaaabbbbcccc
streampath_3=/headbash/relay/extra
streamrelayurl_3=http://foo.bar.whatever:80/stream/1074

Administrative pages:
These pages still exist, but now must be explicitly access via
the /index.html path. Information about streams other than stream #1 can
be accessed via /index.html?sid=#

You might also like