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

Refine the local ip and interface retrieve

This commit is contained in:
winlin 2020-05-09 10:40:25 +08:00
parent 26bcc09017
commit 215b1c234b
7 changed files with 85 additions and 81 deletions

View file

@ -621,9 +621,10 @@ static std::string get_host_candidate_ips(SrsConfDirective* c)
{
string candidate = _srs_config->get_stream_caster_gb28181_host(c);
if (candidate == "*" || candidate == "0.0.0.0") {
std::vector<std::string> ips = srs_get_local_ips();
std::vector<SrsIPAddress*>& ips = srs_get_local_ips();
int index = _srs_config->get_stats_network();
return ips.at(index);
SrsIPAddress* ip = ips.at(index);
return ip->ip;
} else {
return candidate;
}