fix bug #73, http callback api support authentication in tcUrl
正在显示
4 个修改的文件
包含
5 行增加
和
3 行删除
| @@ -297,6 +297,7 @@ vhost hooks.callback.srs.com { | @@ -297,6 +297,7 @@ vhost hooks.callback.srs.com { | ||
| 297 | # "action": "on_connect", | 297 | # "action": "on_connect", |
| 298 | # "client_id": 1985, | 298 | # "client_id": 1985, |
| 299 | # "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live", | 299 | # "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live", |
| 300 | + # "tcUrl": "rtmp://video.test.com/live?key=d2fa801d08e3f90ed1e1670e6e52651a", | ||
| 300 | # "pageUrl": "http://www.test.com/live.html" | 301 | # "pageUrl": "http://www.test.com/live.html" |
| 301 | # } | 302 | # } |
| 302 | # if valid, the hook must return HTTP code 200(Stauts OK) and response | 303 | # if valid, the hook must return HTTP code 200(Stauts OK) and response |
| @@ -133,8 +133,8 @@ class RESTClients(object): | @@ -133,8 +133,8 @@ class RESTClients(object): | ||
| 133 | def __on_connect(self, req): | 133 | def __on_connect(self, req): |
| 134 | code = Error.success | 134 | code = Error.success |
| 135 | 135 | ||
| 136 | - trace("srs %s: client id=%s, ip=%s, vhost=%s, app=%s, pageUrl=%s"%( | ||
| 137 | - req["action"], req["client_id"], req["ip"], req["vhost"], req["app"], req["pageUrl"] | 136 | + trace("srs %s: client id=%s, ip=%s, vhost=%s, app=%s, tcUrl=%s, pageUrl=%s"%( |
| 137 | + req["action"], req["client_id"], req["ip"], req["vhost"], req["app"], req["tcUrl"], req["pageUrl"] | ||
| 138 | )) | 138 | )) |
| 139 | 139 | ||
| 140 | # TODO: process the on_connect event | 140 | # TODO: process the on_connect event |
| @@ -69,6 +69,7 @@ int SrsHttpHooks::on_connect(string url, int client_id, string ip, SrsRequest* r | @@ -69,6 +69,7 @@ int SrsHttpHooks::on_connect(string url, int client_id, string ip, SrsRequest* r | ||
| 69 | << JFIELD_STR("ip", ip) << JFIELD_CONT | 69 | << JFIELD_STR("ip", ip) << JFIELD_CONT |
| 70 | << JFIELD_STR("vhost", req->vhost) << JFIELD_CONT | 70 | << JFIELD_STR("vhost", req->vhost) << JFIELD_CONT |
| 71 | << JFIELD_STR("app", req->app) << JFIELD_CONT | 71 | << JFIELD_STR("app", req->app) << JFIELD_CONT |
| 72 | + << JFIELD_STR("tcUrl", req->tcUrl) << JFIELD_CONT | ||
| 72 | << JFIELD_STR("pageUrl", req->pageUrl) | 73 | << JFIELD_STR("pageUrl", req->pageUrl) |
| 73 | << JOBJECT_END; | 74 | << JOBJECT_END; |
| 74 | std::string data = ss.str(); | 75 | std::string data = ss.str(); |
| @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 31 | // current release version | 31 | // current release version |
| 32 | #define VERSION_MAJOR "0" | 32 | #define VERSION_MAJOR "0" |
| 33 | #define VERSION_MINOR "9" | 33 | #define VERSION_MINOR "9" |
| 34 | -#define VERSION_REVISION "108" | 34 | +#define VERSION_REVISION "109" |
| 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION | 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION |
| 36 | // server info. | 36 | // server info. |
| 37 | #define RTMP_SIG_SRS_KEY "SRS" | 37 | #define RTMP_SIG_SRS_KEY "SRS" |
-
请 注册 或 登录 后发表评论