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

Support filter RTC candidate by ip family, ipv4 by default.

This commit is contained in:
winlin 2020-05-09 10:53:52 +08:00
parent 215b1c234b
commit c31ffc40e4
4 changed files with 65 additions and 1 deletions

View file

@ -3645,7 +3645,8 @@ 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 != "sendmmsg" && n != "encrypt" && n != "reuseport" && n != "gso" && n != "merge_nalus"
&& n != "padding" && n != "perf_stat" && n != "queue_length" && n != "black_hole") {
&& n != "padding" && n != "perf_stat" && n != "queue_length" && n != "black_hole"
&& n != "ip_family") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal rtc_server.%s", n.c_str());
}
}
@ -4747,6 +4748,23 @@ std::string SrsConfig::get_rtc_server_candidates()
return conf->arg0();
}
std::string SrsConfig::get_rtc_server_ip_family()
{
static string DEFAULT = "ipv4";
SrsConfDirective* conf = root->get("rtc_server");
if (!conf) {
return DEFAULT;
}
conf = conf->get("ip_family");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return conf->arg0();
}
bool SrsConfig::get_rtc_server_ecdsa()
{
static bool DEFAULT = true;