[Icecast-dev] [PATCH] auth_hash module

Sergiy piratfm at gmail.com
Fri Mar 12 10:57:33 PST 2010


Hi all.
Here is my first patch for icecast:

auth_hash.diff - this patch created to generate unique URL's that gives
access to listeners.

It also privides GeoIP checking for radiostations, that have some
restrictions to audience from other counties.

Here is sample config:

    <mount>
        <mount-name>/live</mount-name>
        <authentication type="hash">
                <!-- secret word to be md5'ed -->
                <option name="secret" value="hackme"/>
                <!-- maximal time difference in seconds between real
time and time that got from url -->
                <option name="lifetime" value="7200"/>
                <!-- if enabled, then users only from this country
allowed to connect -->
                <option name="geoip_country" value="MD"/>
        </authentication>
    </mount>


Here is sample of unique URL generator:
$time = time();
$client_ip = $_SERVER['REMOTE_ADDR'];
$md5 = md5($time.$client_ip.'hackme');
$url= "http://icecast:8000/live?hash=$md5&time=$time";



-- 
________________
      (\__/)
      (='.'=)
      (")_(")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: auth_hash.diff
Type: text/x-diff
Size: 11278 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/icecast-dev/attachments/20100312/a7ea340a/attachment.diff 


More information about the Icecast-dev mailing list