Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IP geoblocking

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
barichon



Joined: 16 Mar 2010
Posts: 3

PostPosted: Mon Apr 26, 2010 10:38 am    Post subject: IP geoblocking Reply with quote

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
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Apr 26, 2010 12:32 pm    Post subject: Reply with quote

use auth via url (listener_add), you can then use whatever checks you want on the listeners IP.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jorgosch



Joined: 12 Dec 2009
Posts: 13

PostPosted: Fri May 07, 2010 9:17 pm    Post subject: Reply with quote

Wouldn't it be great, though, if Icecast already supported the free Maxmind geoip country database?
Back to top
View user's profile Send private message
als



Joined: 14 Oct 2008
Posts: 18

PostPosted: Fri May 28, 2010 3:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
jorgosch



Joined: 12 Dec 2009
Posts: 13

PostPosted: Fri May 28, 2010 3:16 pm    Post subject: Reply with quote

Ah yes, the joys of Linux. Not so simple on Windows, no Pearl pre-installed.
Back to top
View user's profile Send private message
als



Joined: 14 Oct 2008
Posts: 18

PostPosted: Wed Jun 02, 2010 3:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
robertut



Joined: 31 Aug 2007
Posts: 156

PostPosted: Thu Jan 19, 2012 12:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
dards



Joined: 01 Mar 2011
Posts: 23
Location: Dubai

PostPosted: Wed Jan 25, 2012 12:12 pm    Post subject: Extra post parameter for authentication Reply with quote

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
View user's profile Send private message Visit poster's website
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Jan 25, 2012 1:13 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
dards



Joined: 01 Mar 2011
Posts: 23
Location: Dubai

PostPosted: Thu Jan 26, 2012 10:30 am    Post subject: Reply with quote

Thanks KarlH,

That works perfectly!!

Smile
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber