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
2013-12-08 12:48:03 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3fd3ac5a118cce3cc1255730c8ef367ad778d438
3fd3ac5a
1 parent
889ad923
support http hooks: on_connect/close/publish/unpublish/play/stop.
显示空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
35 行增加
和
1 行删除
trunk/conf/srs.conf
trunk/src/core/srs_core_config.cpp
trunk/conf/srs.conf
查看文件 @
3fd3ac5
...
...
@@ -88,7 +88,8 @@ vhost dev {
#forward 127.0.0.1:19350;
#forward 127.0.0.1:1936;
http_hooks
{
on_connect
http
://
127
.
0
.
0
.
1
:
8085
/
api
/
v1
/
clients
http
://
localhost
:
8085
/
api
/
v1
/
clients
;
enabled
on
;
on_connect
http
://
127
.
0
.
0
.
1
:
8085
/
api
/
v1
/
clients
;
on_close
http
://
127
.
0
.
0
.
1
:
8085
/
api
/
v1
/
clients
;
on_publish
http
://
127
.
0
.
0
.
1
:
8085
/
api
/
v1
/
streams
;
on_unpublish
http
://
127
.
0
.
0
.
1
:
8085
/
api
/
v1
/
streams
;
...
...
@@ -136,6 +137,9 @@ vhost dev {
# the http hook callback vhost, srs will invoke the hooks for specified events.
vhost
hooks
.
callback
.
vhost
.
com
{
http_hooks
{
# whether the http hooks enalbe.
# default off.
enabled
on
;
# when client connect to vhost/app, call the hook,
# the request in the POST data string is a object encode by json:
# {
...
...
trunk/src/core/srs_core_config.cpp
查看文件 @
3fd3ac5
...
...
@@ -575,6 +575,11 @@ SrsConfDirective* SrsConfig::get_vhost_on_connect(std::string vhost)
return
NULL
;
}
SrsConfDirective
*
enabled
=
conf
->
get
(
"enabled"
);
if
(
!
enabled
||
enabled
->
arg0
()
!=
"on"
)
{
return
NULL
;
}
return
conf
->
get
(
"on_connect"
);
}
...
...
@@ -591,6 +596,11 @@ SrsConfDirective* SrsConfig::get_vhost_on_close(std::string vhost)
return
NULL
;
}
SrsConfDirective
*
enabled
=
conf
->
get
(
"enabled"
);
if
(
!
enabled
||
enabled
->
arg0
()
!=
"on"
)
{
return
NULL
;
}
return
conf
->
get
(
"on_close"
);
}
...
...
@@ -607,6 +617,11 @@ SrsConfDirective* SrsConfig::get_vhost_on_publish(std::string vhost)
return
NULL
;
}
SrsConfDirective
*
enabled
=
conf
->
get
(
"enabled"
);
if
(
!
enabled
||
enabled
->
arg0
()
!=
"on"
)
{
return
NULL
;
}
return
conf
->
get
(
"on_publish"
);
}
...
...
@@ -623,6 +638,11 @@ SrsConfDirective* SrsConfig::get_vhost_on_unpublish(std::string vhost)
return
NULL
;
}
SrsConfDirective
*
enabled
=
conf
->
get
(
"enabled"
);
if
(
!
enabled
||
enabled
->
arg0
()
!=
"on"
)
{
return
NULL
;
}
return
conf
->
get
(
"on_unpublish"
);
}
...
...
@@ -639,6 +659,11 @@ SrsConfDirective* SrsConfig::get_vhost_on_play(std::string vhost)
return
NULL
;
}
SrsConfDirective
*
enabled
=
conf
->
get
(
"enabled"
);
if
(
!
enabled
||
enabled
->
arg0
()
!=
"on"
)
{
return
NULL
;
}
return
conf
->
get
(
"on_play"
);
}
...
...
@@ -655,6 +680,11 @@ SrsConfDirective* SrsConfig::get_vhost_on_stop(std::string vhost)
return
NULL
;
}
SrsConfDirective
*
enabled
=
conf
->
get
(
"enabled"
);
if
(
!
enabled
||
enabled
->
arg0
()
!=
"on"
)
{
return
NULL
;
}
return
conf
->
get
(
"on_stop"
);
}
...
...
请
注册
或
登录
后发表评论