<authentication type="url"> <option name="listener_add" value='http://Ваш домен или где будет лежать скрипт (главное - здесь должен быть url)/listener_add.php'/> <option name="auth_header" value="icecast-auth-user: 1"/> <option name="presume_innocent" value="yes"/> <option name="handlers" value="50"/> </authentication>
<?php $ag = $_POST['agent']; if ((strpos($ag, 'Mozilla') !== false) || (strpos($ag, 'Opera') !== false) || (strpos($ag, 'Internet%20') !== false)) { header("icecast-auth-user: 1"); } else { header("icecast-auth-user: 0"); } ?>
<mount> <mount-name>/name.mp3</mount-name> <authentication type="url"> <option name="listener_add" value='http://example.ru/auth/listener_add.php'/> <option name="auth_header" value="icecast-auth-user: 1"/> <option name="presume_innocent" value="yes"/> <option name="handlers" value="50"/> </authentication> </mount>
<?php $www = $_SERVER['HTTP_HOST']; $hostname = 'example'; $auth = strripos($www, $hostname); if ($auth === false) { "icecast-auth-user: 0"; } else { "icecast-auth-user: 1"; } ?>
<?php $www = $_SERVER['HTTP_HOST']; $hostname = 'www.example.ru'; if (strpos($www, $hostname) == false) { "icecast-auth-user: 0"; } else { "icecast-auth-user: 1"; } ?>
if (strpos($www, $hostname) === false) {
<?php $req_url = parse_url($_POST['referer'], PHP_URL_HOST); $player_host = 'example.com'; if (strpos($req_url, $player_host) !== false) { header("icecast-auth-user: 1"); } else { header("icecast-auth-user: 0"); } ?>