Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

推流的时候能加帐号密码吗? #25

Open
netsmu opened this issue Oct 18, 2017 · 6 comments
Open

推流的时候能加帐号密码吗? #25

netsmu opened this issue Oct 18, 2017 · 6 comments

Comments

@netsmu
Copy link

netsmu commented Oct 18, 2017

你好,我正在使用您开发的 nginx-rtmp-win32
目前使用正常,有个问题就是,推流的时候怎么设置帐号密码呢?如果不设置帐号密码,那拉流跟推流地址一样,那别人就会找到拉流地址而用来推流。 这样就很不方便。
所以我想问一下,推流的时候不是可以输入帐号密码,这样防止被别人推流吗?
不知道这个 nginx-rtmp-win32 有没有这个功能呢?
谢谢。
如下所示。
RTMP上传服务器地址:
192.168.110.155
RTMP上传服务器端口:
1935
RTMP上传目录名:
hls
RTMP上传节点:
hx
RTMP上传用户名:
11
RTMP上传密码:
22

@illuspas
Copy link
Owner

目前是没有用户名密码这套验证机制的
不过可以采用推流与播放使用不同app_name的方式,并开启鉴权功能
刚刚我测试发现一个问题,等我修复一下

@illuspas
Copy link
Owner

可以采用这种方式:

application play {
    live on;
    allow publish 127.0.0.1;
    deny publish all;
}

application push {
    live on;
    allow play 127.0.0.1;
    deny play all;
    live_auth on;  #鉴权开关
    live_auth_secret nodemedia2017privatekey; #鉴权KEY
    push rtmp://localhost/play/;
}

push 这个app只允许客户端推流,不允许播放,并且开启的鉴权,并将流转推到app:play下。
play 这个app只允许客户端播放,不允许推流,没有开鉴权。需要的话也可以打开。

用最新的提交 9219e7a 修复了本地进行relay时鉴权验证失败的问题。

@netsmu
Copy link
Author

netsmu commented Oct 19, 2017

谢谢了。已经用楼上的方法解决了。

这里还可以用另外一种方法。如下。
application livezijizhidaojiuhao { #这个推流APP自己知道就好,不要让别人知道。
live on;
transcode on;
transcode_appname hls;
}
application hls {
live on;
hls on;
hls_path temp/hls;
hls_fragment 8s;
allow publish 127.0.0.1;
deny publish all;
allow play all;
}
hls 这个只允许客户端播放,不允许推流。
livezijizhidaojiuhao 这个推流APP,名称改一个自己知道的就好了,不要让别人知道了。
这样就很安全了。

@illuspas
Copy link
Owner

transcode on;
transcode_appname hls;
这个是早期一个版本了,现在转码已经不是这种形式了

@netsmu
Copy link
Author

netsmu commented Oct 19, 2017

我用的版本是 从这里下载的 Release version 1.2
所以直接用 transcode on; transcode_appname hls; 就可以了。
谢谢。

@illuspas
Copy link
Owner

illuspas commented Oct 19, 2017

哦,是的,最新的版本没有发release
1.2那个版本,默认转码是带上音频转码的。
如果没有音频流而这样使用的话,可能是这个问题的原因 #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants