admin 发表于 2020-4-27 00:01:01

第三方鉴权接口说明

http://www.qiyicc.com/rtmp/smart_rtmpd_stream.png
-------------------------------------------------------------------------------------------------------------------------------------------------------
一分钟快速搭建 rtmpd 服务器: https://blog.csdn.net/freeabc/article/details/102880984
软件下载地址: http://www.qiyicc.com/download/rtmpd.rar
github 地址:https://github.com/superconvert/smart_rtmpd
-------------------------------------------------------------------------------------------------------------------------------------------------------


第三方鉴权接口使用说明


接口:
smart rtmpd 发送 http request ( PUT url + param )
第三方平台  响应 http response (成功:200 OK,其余表示失败)

要求:
要求 500 ms 内返回鉴定结果,


准备:
如果想支持第三方鉴权,需要在 smart rtmpd 的配置文件 config.xml 里
配置选项 <authurl> 。如果你鉴权服务器地址为: 192.168.1.1,端口: 8080
那么就需要修改配置文件 config.xml 里的 <authurl>
    <authurl>192.168.1.1:8080</authurl>
配置完毕启动或重启 smart rtmpd


功能:
鉴权针对 rtmp 推流,拉流,http-flv, http-hls, http-dash 拉流,rtsp 推流,
拉流等进行鉴权服务。可以把 smart rtmpd 完美的对接到您现有的运营系统。


rtmp 鉴权 url 说明:
针对 rtmp 推流或拉流,一般 rtmp 推流或拉流 url 是这种格式

  rtmp://192.168.1.1/live/stream?user=admin&token=xqtv312

那么进行鉴权时,smart rtmpd 会把此 url 转换成鉴权 url 如下面格式

  http://第三方鉴权地址/live/stream?user=admin&token=xqtv312&type=rtmp&role=publisher

smart rtmpd 会追加自己的参数进去,追加字段如下:
1. 参数 type 表示协议类型,目前只有 rtmp, http, rtsp 三种。
2. 参数 role 表示这个 url 的角色,目前只分为两种 publisher(发布者) 和 player (播放端)

其余 url 会保持不变,只会去掉前面的 rtmp://192.168.1.1,后面的保持不变

再举一例 rtmp 推流或拉流 url

  rtmp://192.168.1.1/vod/stream?user=admin&token=xqtv312

那么鉴权 url

  http://第三方鉴权地址/vod/stream?user=admin&token=xqtv312&type=rtmp&role=publisher

live 表示直播,vod 表示点播,第三方平台可以解析这些字段判断用户是直播还是点播


http 鉴权 url 格式说明:
对于 http-flv, http-hls, http-dash 的拉流 url 格式一般如下
  http://192.168.1.1/live/stream.flv?user=admin&token=xqtv312 ( http-flv )
  http://192.168.1.1/live/stream.m3u8?user=admin&token=xqtv312 ( http-m3u8 )
  http://192.168.1.1/live/stream.mpd?user=admin&token=xqtv312 ( http-mpd )

那么 smart rtmpd 会把此 url 转换成鉴权 url 如下面格式

  http://第三方鉴权地址/live/stream.flv?user=admin&token=xqtv312&type=rtmp&role=player
  http://第三方鉴权地址/live/stream.m3u8?user=admin&token=xqtv312&type=rtmp&role=player
  http://第三方鉴权地址/live/stream.mpd?user=admin&token=xqtv312&type=rtmp&role=player

同样 smart rtmpd 会追加参数 type 和 role,同时把 http://192.168.1.1 去掉,后面的保持不变


rtsp 鉴权 url 格式说明:
对于 rtsp 推流和拉流 url 格式一般如下
  rtsp://192.168.1.1/live/stream?user=admin&token=xqtv312
那么 smart rtmpd 会把此 url 转换成鉴权 url 如下面格式

  http://第三方鉴权地址/live/stream?user=admin&token=xqtv312&type=rtsp&role=player

同样 smart rtmpd 会追加参数 type 和 role,同时把 http://192.168.1.1 去掉,后面的保持不变

页: [1]
查看完整版本: 第三方鉴权接口说明