mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
change to 0.9.37, for http api/stream
This commit is contained in:
parent
041a07dfda
commit
aa89f9f51e
14 changed files with 1205 additions and 950 deletions
|
@ -1466,6 +1466,79 @@ double SrsConfig::get_hls_window(string vhost)
|
|||
return ::atof(conf->arg0().c_str());
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_http_api()
|
||||
{
|
||||
return root->get("http_api");
|
||||
}
|
||||
|
||||
bool SrsConfig::get_http_api_enabled()
|
||||
{
|
||||
SrsConfDirective* conf = get_http_api();
|
||||
|
||||
if (!conf) {
|
||||
return false;
|
||||
}
|
||||
|
||||
conf = conf->get("enabled");
|
||||
if (conf && conf->arg0() == "on") {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int SrsConfig::get_http_api_listen()
|
||||
{
|
||||
SrsConfDirective* conf = get_http_api();
|
||||
|
||||
if (conf) {
|
||||
conf = conf->get("listen");
|
||||
|
||||
if (conf && !conf->arg0().empty()) {
|
||||
return ::atoi(conf->arg0().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
return 1985;
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_http_stream()
|
||||
{
|
||||
return root->get("http_stream");
|
||||
}
|
||||
|
||||
bool SrsConfig::get_http_stream_enabled()
|
||||
{
|
||||
SrsConfDirective* conf = get_http_stream();
|
||||
|
||||
if (!conf) {
|
||||
return false;
|
||||
}
|
||||
|
||||
conf = conf->get("enabled");
|
||||
|
||||
if (conf && conf->arg0() == "on") {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int SrsConfig::get_http_stream_listen()
|
||||
{
|
||||
SrsConfDirective* conf = get_http_stream();
|
||||
|
||||
if (conf) {
|
||||
conf = conf->get("listen");
|
||||
|
||||
if (conf && !conf->arg0().empty()) {
|
||||
return ::atoi(conf->arg0().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
return 8080;
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_refer(string vhost)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue