Permalink
Browse files

增加仿星域CDN的鉴权功能

  • Loading branch information...
illuspas committed Mar 22, 2017
1 parent 27e23e4 commit ba10c3cc704e1addb1169f977d79ae1b691ed31e
Showing with 15 additions and 1 deletion.
  1. +11 −0 auth_gen.php
  2. +3 −1 conf/nginx.conf
  3. BIN nginx.exe
  4. +1 −0 stop.bat
View
@@ -0,0 +1,11 @@
<?php
$auth_key = 'nodemedia2017privatekey';
$server = 'rtmp://localhost/';
$app = 'live';
$name = 'stream123';
$ts = time()+60; //1分钟后失效
$data = '/'.$app.'/'.$name.'-'.$ts.'-'.$auth_key;
// echo $data."\n";
$md5 = md5($data, false);
echo $server.$app.'/'.$name.'?sign='.$ts.'-'.$md5."\n";
?>
View
4 conf/nginx.conf 100644 → 100755
@@ -1,6 +1,6 @@
worker_processes 1;
error_log logs/error.log debug;
#error_log logs/error.log debug;
events {
worker_connections 1024;
@@ -12,6 +12,8 @@ rtmp {
application live {
live on;
live_auth off; #鉴权开关
live_auth_secret nodemedia2017privatekey; #鉴权KEY
}
application hls {
View
BIN nginx.exe
Binary file not shown.
View
@@ -0,0 +1 @@
nginx.exe -s stop

0 comments on commit ba10c3c

Please sign in to comment.