View previous topic :: View next topic |
Author |
Message |
barichon
Joined: 16 Mar 2010 Posts: 3
|
Posted: Mon Apr 26, 2010 10:38 am Post subject: IP geoblocking |
|
|
Hello guys,
I'm looking for the way to delivery streams to only this or this country... (and why no with an updated db... because of ip reallocation)
Could you advice me please ?
Thx by advance,
Regards,
Romain. |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Apr 26, 2010 12:32 pm Post subject: |
|
|
use auth via url (listener_add), you can then use whatever checks you want on the listeners IP.
karl. |
|
Back to top |
|
|
jorgosch
Joined: 12 Dec 2009 Posts: 13
|
Posted: Fri May 07, 2010 9:17 pm Post subject: |
|
|
Wouldn't it be great, though, if Icecast already supported the free Maxmind geoip country database? |
|
Back to top |
|
|
als
Joined: 14 Oct 2008 Posts: 18
|
Posted: Fri May 28, 2010 3:06 pm Post subject: |
|
|
jorgosch wrote: |
Wouldn't it be great, though, if Icecast already supported the free Maxmind geoip country database? |
I have it up and running with simple perl script (using use Geo::IP; ) with icecast authorisation as:
Code: |
<authentication type="command">
<option name="listener_add" value="/usr/.../check_country"/>
</authentication>
|
script looks for country in maxmind's database & if country is our local - authorises listener with
print "icecast-auth-user: 1\n";
or redirects it to another mountpoint with limited bitrate & listener count
code itself is 10 lines |
|
Back to top |
|
|
jorgosch
Joined: 12 Dec 2009 Posts: 13
|
Posted: Fri May 28, 2010 3:16 pm Post subject: |
|
|
Ah yes, the joys of Linux. Not so simple on Windows, no Pearl pre-installed. |
|
Back to top |
|
|
als
Joined: 14 Oct 2008 Posts: 18
|
Posted: Wed Jun 02, 2010 3:11 pm Post subject: |
|
|
jorgosch wrote: |
Ah yes, the joys of Linux. Not so simple on Windows, no Pearl pre-installed. |
Eeasy:
http://www.activestate.com/activeperl
Actually one of the perl goodies is that scripts can be run everywhere |
|
Back to top |
|
|
robertut
Joined: 31 Aug 2007 Posts: 156
|
Posted: Thu Jan 19, 2012 12:41 pm Post subject: |
|
|
als wrote: |
jorgosch wrote: |
Wouldn't it be great, though, if Icecast already supported the free Maxmind geoip country database? |
I have it up and running with simple perl script (using use Geo::IP; ) with icecast authorisation as:
Code: |
<authentication type="command">
<option name="listener_add" value="/usr/.../check_country"/>
</authentication>
|
script looks for country in maxmind's database & if country is our local - authorises listener with
print "icecast-auth-user: 1\n";
or redirects it to another mountpoint with limited bitrate & listener count
code itself is 10 lines |
Can you share the perl code? |
|
Back to top |
|
|
dards
Joined: 01 Mar 2011 Posts: 23 Location: Dubai
|
Posted: Wed Jan 25, 2012 12:12 pm Post subject: Extra post parameter for authentication |
|
|
Hi Everyone and Kharl,
My question is related to this topic as its all about Geo-locking.
I am currently adding features on my RadioBox-HD for Geo-locking and I want to add extra parameter on the authentication configuration such as an example below:
Code: |
<authentication type="url">
<option name="listener_add" value="http://[server]/auth_add_listener.php"/>
<option name="listener_remove" value="http://[server]/auth_del_listener.php"/>
<option name="auth_header" value="icecast-auth-user: 1"/>
<option name="timelimit_header" value="icecast-auth-timelimit:"/>
<option name="station" value="stationname"/>
</authentication>
|
as you see I put extra option <option name="station" ....... as I want to send that to the main server during the post for MySQL database query this will allow me to find certain station and applied the blocking base on the ip address.
I tried that configuration and reload the configuration on icecast while running and it works but when I restart the Icecast server then the value does not sent anymore on the post, I restarted the icecast several times but no luck, I was wondering why it work for the first time and does not work anymore
Hope somebody has gone to this issue and can suggest me if I am wrong with the settings.
thanks
dards |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Jan 25, 2012 1:13 pm Post subject: |
|
|
it may be a hack but have you tried setting a query arg to the url eg
<option name="listener_add" value="http://[server]/auth_add_listener.php?station=abcdef"/>
karl. |
|
Back to top |
|
|
dards
Joined: 01 Mar 2011 Posts: 23 Location: Dubai
|
Posted: Thu Jan 26, 2012 10:30 am Post subject: |
|
|
Thanks KarlH,
That works perfectly!!
|
|
Back to top |
|
|
|