mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add server_id into http_hooks (#2521)
Co-authored-by: SK <liemlhd@LiemLes-Mac-Pro.local>
This commit is contained in:
parent
dffc344747
commit
452ca7e88f
2 changed files with 35 additions and 9 deletions
|
@ -1078,7 +1078,7 @@ vhost hooks.callback.srs.com {
|
|||
# "client_id": 1985,
|
||||
# "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
|
||||
# "tcUrl": "rtmp://video.test.com/live?key=d2fa801d08e3f90ed1e1670e6e52651a",
|
||||
# "pageUrl": "http://www.test.com/live.html"
|
||||
# "pageUrl": "http://www.test.com/live.html", "server_id": "vid-werty"
|
||||
# }
|
||||
# if valid, the hook must return HTTP code 200(Status OK) and response
|
||||
# an int value specifies the error code(0 corresponding to success):
|
||||
|
@ -1094,7 +1094,7 @@ vhost hooks.callback.srs.com {
|
|||
# "action": "on_close",
|
||||
# "client_id": 1985,
|
||||
# "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
|
||||
# "send_bytes": 10240, "recv_bytes": 10240
|
||||
# "send_bytes": 10240, "recv_bytes": 10240, "server_id": "vid-werty"
|
||||
# }
|
||||
# if valid, the hook must return HTTP code 200(Status OK) and response
|
||||
# an int value specifies the error code(0 corresponding to success):
|
||||
|
@ -1110,7 +1110,7 @@ vhost hooks.callback.srs.com {
|
|||
# "action": "on_publish",
|
||||
# "client_id": 1985,
|
||||
# "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
|
||||
# "stream": "livestream", "param":"?token=xxx&salt=yyy"
|
||||
# "stream": "livestream", "param":"?token=xxx&salt=yyy", "server_id": "vid-werty"
|
||||
# }
|
||||
# if valid, the hook must return HTTP code 200(Status OK) and response
|
||||
# an int value specifies the error code(0 corresponding to success):
|
||||
|
@ -1126,7 +1126,7 @@ vhost hooks.callback.srs.com {
|
|||
# "action": "on_unpublish",
|
||||
# "client_id": 1985,
|
||||
# "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
|
||||
# "stream": "livestream", "param":"?token=xxx&salt=yyy"
|
||||
# "stream": "livestream", "param":"?token=xxx&salt=yyy", "server_id": "vid-werty"
|
||||
# }
|
||||
# if valid, the hook must return HTTP code 200(Status OK) and response
|
||||
# an int value specifies the error code(0 corresponding to success):
|
||||
|
@ -1143,7 +1143,7 @@ vhost hooks.callback.srs.com {
|
|||
# "client_id": 1985,
|
||||
# "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
|
||||
# "stream": "livestream", "param":"?token=xxx&salt=yyy",
|
||||
# "pageUrl": "http://www.test.com/live.html"
|
||||
# "pageUrl": "http://www.test.com/live.html", "server_id": "vid-werty"
|
||||
# }
|
||||
# if valid, the hook must return HTTP code 200(Status OK) and response
|
||||
# an int value specifies the error code(0 corresponding to success):
|
||||
|
@ -1159,7 +1159,7 @@ vhost hooks.callback.srs.com {
|
|||
# "action": "on_stop",
|
||||
# "client_id": 1985,
|
||||
# "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
|
||||
# "stream": "livestream", "param":"?token=xxx&salt=yyy"
|
||||
# "stream": "livestream", "param":"?token=xxx&salt=yyy", "server_id": "vid-werty"
|
||||
# }
|
||||
# if valid, the hook must return HTTP code 200(Status OK) and response
|
||||
# an int value specifies the error code(0 corresponding to success):
|
||||
|
@ -1177,7 +1177,7 @@ vhost hooks.callback.srs.com {
|
|||
# "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
|
||||
# "stream": "livestream", "param":"?token=xxx&salt=yyy",
|
||||
# "cwd": "/usr/local/srs",
|
||||
# "file": "./objs/nginx/html/live/livestream.1420254068776.flv"
|
||||
# "file": "./objs/nginx/html/live/livestream.1420254068776.flv", "server_id": "vid-werty"
|
||||
# }
|
||||
# if valid, the hook must return HTTP code 200(Status OK) and response
|
||||
# an int value specifies the error code(0 corresponding to success):
|
||||
|
@ -1196,7 +1196,7 @@ vhost hooks.callback.srs.com {
|
|||
# "url": "live/livestream/2015-04-23/01/476584165.ts",
|
||||
# "m3u8": "./objs/nginx/html/live/livestream/live.m3u8",
|
||||
# "m3u8_url": "live/livestream/live.m3u8",
|
||||
# "seq_no": 100
|
||||
# "seq_no": 100, "server_id": "vid-werty"
|
||||
# }
|
||||
# if valid, the hook must return HTTP code 200(Status OK) and response
|
||||
# an int value specifies the error code(0 corresponding to success):
|
||||
|
@ -1205,13 +1205,14 @@ vhost hooks.callback.srs.com {
|
|||
# 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:
|
||||
# [server_id], replace with the server_id
|
||||
# [app], replace with the app.
|
||||
# [stream], replace with the stream.
|
||||
# [param], replace with the param.
|
||||
# [ts_url], replace with the ts url.
|
||||
# ignore any return data of server.
|
||||
# @remark random select a url to report, not report all.
|
||||
on_hls_notify http://127.0.0.1:8085/api/v1/hls/[app]/[stream]/[ts_url][param];
|
||||
on_hls_notify http://127.0.0.1:8085/api/v1/hls/[server_id]/[app]/[stream]/[ts_url][param];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue