准备使用Red5应用程序



我正在寻找一个现有的Red5应用程序。

我们的需求非常基本:
*只需要一个提要
**按IP地址或用户/通行证限制广播
**按用户/通行或令牌限制观看

我发现了视频耳语,但它似乎缺乏身份验证功能。

一个开源应用程序会很棒,但如果成本不太高,我可以接受商业产品。

RTMPT解决方案似乎可以很好地限制观看访问,但任何人都可以在未经授权的情况下在我的服务器上开始广播。如何限制广播访问?

我使用RTMPT(RTMP over HTTP)使用以下IP安全机制:

所有RTMPT请求都通过在我的apache配置中使用mod_proxy传递到red5(端口5080),除了/open/1请求:

#send open/1 request to authentification script:
Alias /open/1 /var/www/html/auth.php
#other RTMP request directly to red5:
ProxyPass /send http://localhost:5080/send
ProxyPassReverse /send http://localhost:5080/send
ProxyPass /idle http://localhost:5080/idle
ProxyPassReverse /idle http://localhost:5080/idle
ProxyPass /close http://localhost:5080/close
ProxyPassReverse /close http://localhost:5080/close
ProxyPass /fcs http://localhost:5080/fcs
ProxyPassReverse /fcs http://localhost:5080/fcs

当用户启动播放器时,网页将首先联系php脚本来验证用户是否登录。如果是,则其IP地址将被临时存储,包括当前时间(时间戳)。然后RTMPT流将在端口80上启动。现在auth.php脚本将接收来自播放器的/open/1请求。它将检查IP地址和时间戳。如果IP地址存在并且时间戳不早于约3秒,则/open/1请求将传递给red5。结果(标识符)被传递回玩家。在PHP中:

<?php
//after user is verified, send /open/1 request to red5:
$data = `curl -s -F a=b localhost:5080/open/1`;
$data_size = strlen($data);
header("Content-Type: application/x-fcs");
header("Connection: Keep-Alive");
header("Content-Length: $data_size");
header('Cache-Control: no-cache');
echo $data;  //return answer from red5 (identifier) back to player
exit;
?>

不幸的是,/open/1请求不包含任何cookie或来自网页的referer信息,只有来自客户端的REMOTE_ADDR(IP地址)和request_TIME是来自PHP$_SERVER变量的有用信息(使用JW播放器)。

最新更新