1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Discover api server and ip as candidates. v4.0.218

This commit is contained in:
winlin 2022-01-04 22:18:38 +08:00
parent 013fa8ac6c
commit fbb6d9464c
9 changed files with 97 additions and 22 deletions

View file

@ -2542,7 +2542,7 @@ srs_error_t SrsConfig::check_normal_config()
string n = conf->at(i)->name;
if (n != "enabled" && n != "listen" && n != "dir" && n != "candidate" && n != "ecdsa"
&& n != "encrypt" && n != "reuseport" && n != "merge_nalus" && n != "black_hole"
&& n != "ip_family") {
&& n != "ip_family" && n != "api_as_candidates") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal rtc_server.%s", n.c_str());
}
}
@ -3544,6 +3544,23 @@ std::string SrsConfig::get_rtc_server_candidates()
return conf->arg0();
}
bool SrsConfig::get_api_as_candidates()
{
static bool DEFAULT = true;
SrsConfDirective* conf = root->get("rtc_server");
if (!conf) {
return DEFAULT;
}
conf = conf->get("api_as_candidates");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return SRS_CONF_PERFER_TRUE(conf->arg0());
}
std::string SrsConfig::get_rtc_server_ip_family()
{
static string DEFAULT = "ipv4";