From 504e93ba10dea94eb53ba874c1082f47f57eda80 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 5 Sep 2024 19:23:01 +0800 Subject: [PATCH] Report both udp and tcp port for WebRTC. --- trunk/src/app/srs_app_heartbeat.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/trunk/src/app/srs_app_heartbeat.cpp b/trunk/src/app/srs_app_heartbeat.cpp index 7ddeed7330..c4ca019b7e 100644 --- a/trunk/src/app/srs_app_heartbeat.cpp +++ b/trunk/src/app/srs_app_heartbeat.cpp @@ -125,7 +125,12 @@ srs_error_t SrsHttpHeartbeat::do_heartbeat() obj->set("rtc", o); int endpoint = _srs_config->get_rtc_server_listen(); - o->append(SrsJsonAny::str(srs_int2str(endpoint).c_str())); + o->append(SrsJsonAny::str(srs_fmt("udp://0.0.0.0:%d", endpoint).c_str())); + + if (_srs_config->get_rtc_server_tcp_enabled()) { + endpoint = _srs_config->get_rtc_server_tcp_listen(); + o->append(SrsJsonAny::str(srs_fmt("tcp://0.0.0.0:%d", endpoint).c_str())); + } } }