View previous topic :: View next topic |
Author |
Message |
chris
Joined: 13 Jun 2012 Posts: 15
|
Posted: Fri Jan 04, 2013 9:53 am Post subject: Auth Command |
|
|
Hi KarlH, hello community!
happy new year
I am searching the web - and this forum - for a way to geoprotect my streams in icecast. I already have a webservice to do url-authentication which is working. But given the fact that i need a high redundancy environment i would like to authenticate direct on the streamingserver (without installing a webserver on all of them).
there are a few posts talking about command-authentication (instead of url) (Example).
I am currently working with version 2.3.3 of Icecast and it does not seem to be working. Am i doing something wrong or is it not included in 2.3.3.
thanks for your time!
chris
Edit:
I installed KH-branch to already try it out, no matter if it will / would work in non-kh or not.
Unfortuanetly, it does not work yet. What is icecast expecting, a return-code 0 as described in auth_cmd.c
Code: |
a return code of 0 indicates a valid user, authentication failure if otherwise |
or a print-value as described by user als (see link above). actually i tried both but it does not work. script is executed, but im unable to connect to the mountpoint.. |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sat Jan 05, 2013 9:35 am Post subject: |
|
|
I ended up making the command auth operate in a similar way to url auth, details are passed one line at a time like IP and responses are returned like icecast-auth-user: 1, icecast reads and process those returned lines like header lines in url auth and control the client in the same way
karl. |
|
Back to top |
|
|
chris
Joined: 13 Jun 2012 Posts: 15
|
Posted: Tue Jan 08, 2013 2:32 pm Post subject: |
|
|
Thanks for your reply, karl.
Do you have an example at hand which you could provide me? My very basic perl-script only does the following:
Code: |
#!/usr/bin/perl
$txt="icecast-auth-user: 1
icecast-auth-message: test\n";
print $txt;
exit 0; |
and the mountpoint-setting looks like this:
Code: |
<mount>
<mount-name>/m/station/mp3_128</mount-name>
<fallback-override>1</fallback-override>
<max-listener-duration>68400</max-listener-duration>
<authentication type="command">
<option name="listener_add" value="/etc/geoip.pl"/>
</authentication>
</mount> |
but it does not work. i think i tried everything
thanks a lot!
chris |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Jan 09, 2013 3:20 am Post subject: |
|
|
When I try the command auth here I see the following
..various auth lines
[2013-01-09 16:14:01] DBUG auth_cmd/auth_cmd_client Waiting on pid 2084
[2013-01-09 16:14:01] DBUG auth/auth_new_listener listener connection failed
the reason for the failure was because there was no empty blank line
at the end of the headers, as soon as the added another \n then it worked
as intended. If you do not get that then you need to send me the log lines
at level 4 with the command auth.
karl. |
|
Back to top |
|
|
chris
Joined: 13 Jun 2012 Posts: 15
|
Posted: Wed Jan 09, 2013 7:30 am Post subject: |
|
|
Thank you Karl, that was very helpful. I tried everything except having two \n's
Have a nice day!
Chris |
|
Back to top |
|
|
|