Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-04-10 15:50:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fe1886aa0857be59fd81ac0a4fe1b9901bbc837c
fe1886aa
1 parent
e5b8e0da
add proxy for hls
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
31 行增加
和
0 行删除
trunk/research/api-server/server.py
trunk/research/api-server/server.py
查看文件 @
fe1886a
...
...
@@ -308,6 +308,36 @@ class RESTDvrs(object):
return
code
'''
handle the hls proxy requests: hls stream.
'''
class
RESTProxy
(
object
):
exposed
=
True
'''
for SRS hook: on_hls_notify
on_hls_notify:
when srs reap a ts file of hls, call this hook,
used to push file to cdn network, by get the ts file from cdn network.
so we use HTTP GET and use the variable following:
[app], replace with the app.
[stream], replace with the stream.
[ts_url], replace with the ts url.
ignore any return data of server.
'''
def
GET
(
self
,
*
args
,
**
kwargs
):
enable_crossdomain
()
hls
=
{
"args"
:
args
,
"kwargs"
:
kwargs
}
ret
=
json
.
dumps
(
hls
)
print
ret
return
ret
'''
handle the hls requests: hls stream.
'''
...
...
@@ -1195,6 +1225,7 @@ class V1(object):
self
.
sessions
=
RESTSessions
()
self
.
dvrs
=
RESTDvrs
()
self
.
hls
=
RESTHls
()
self
.
proxy
=
RESTProxy
()
self
.
chats
=
RESTChats
()
self
.
servers
=
RESTServers
()
self
.
nodes
=
RESTNodes
()
...
...
请
注册
或
登录
后发表评论