diff --git a/trunk/conf/rtc.conf b/trunk/conf/rtc.conf index 03b42c75d..300b81d6f 100644 --- a/trunk/conf/rtc.conf +++ b/trunk/conf/rtc.conf @@ -3,6 +3,7 @@ listen 1935; max_connections 1000; srs_log_tank console; srs_log_file ./objs/srs.log; +daemon off; http_server { enabled on; @@ -21,10 +22,13 @@ rtc { enabled on; # Listen at udp://8000 listen 8000; + # + # The $CANDIDATE means fetch from env, if not configed, use default * as bellow. + # # The * means using IP of network interface stats.network, # For example, if stats.network=0, then use IP of eth0 as candidate. # @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124 - candidate *; + candidate $CANDIDATE; } vhost __defaultVhost__ { diff --git a/trunk/research/players/rtc.html b/trunk/research/players/rtc.html index 80cd1a2c0..550467aa1 100644 --- a/trunk/research/players/rtc.html +++ b/trunk/research/players/rtc.html @@ -16,7 +16,7 @@ rtc_media_player:
var PeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection; var SessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription || window.webkitRTCSessionDescription; -var url = "http://localhost:1985/api/v1/sdp/"; +var url = document.location.protocol + "//" + document.location.hostname + ":1985/api/v1/sdp/"; var method = "POST"; var shouldBeAsync = true; diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index cb47e12e0..b79fdadd7 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -4323,6 +4323,11 @@ std::string SrsConfig::get_rtc_candidates() if (!eip.empty()) { return eip; } + + // If configed as ENV, but no ENV set, use default value. + if (srs_string_starts_with(conf->arg0(), "$")) { + return DEFAULT; + } return (conf->arg0().c_str()); }