[icecast-dev] Client auth with mysql
Mathieu Arnold
mat at mat.cc
Wed May 12 10:24:14 PDT 2004
Hi,
I have a customer (a small french music producer) who's putting up a "paid"
radio, it's not really paid, because you don't buy an access, you just by a
cd, and you get radio access.
So, I needed to check access to the radio, in an intelligent manner :-)
A collegue of mine started doing things, he ended up with scripts adding ip's
to the server's firewall...
I though better of it and I told myself that it should not be that difficult
to add mysql support in icecast (no, no, don't run, please).
So, that's what I did :-)
<http://mat.cc/distfiles/icecast-mysql.diff>
it adds some config params to a <mount> section :
<sql_server>sql-server</sql_server>
<sql_login>login</sql_login>
<sql_password>password</sql_password>
<sql_dbname>database</sql_dbname>
<sql_field>url-field</sql_field>
<sql_query>select cle from client where radio = 1 and cle = '%s'</sql_query>
which are passed to the source it correspond to.
and when you call a source say, /foo.mp3?url-field=something
It'll put the something in the sql query.
It should be connection loss tolerant, but I'm not sure about it :-)
For those wanting to try it, you'll have to have mysql/mysql.h in your
include path, and to add -llibmysqlclient -Lpath to have it compile :-)
If I had known a bit of autoconf & Co, I'd have added a --with-mysql with
proper #ifdef things to comment out my mess, but I don't, if you have a hint
on that, I'll happily do it :-)
ps: all and every comment welcome ;-)
--
Mathieu Arnold
--- >8 ----
List archives: http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Icecast-dev
mailing list