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

For #1638, #307, refactor rtc config.

This commit is contained in:
winlin 2020-03-14 18:05:58 +08:00
parent 6f4584db53
commit a42cf3ae8d
3 changed files with 11 additions and 2 deletions

View file

@ -3,6 +3,7 @@ listen 1935;
max_connections 1000; max_connections 1000;
srs_log_tank console; srs_log_tank console;
srs_log_file ./objs/srs.log; srs_log_file ./objs/srs.log;
daemon off;
http_server { http_server {
enabled on; enabled on;
@ -21,10 +22,13 @@ rtc {
enabled on; enabled on;
# Listen at udp://8000 # Listen at udp://8000
listen 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, # The * means using IP of network interface stats.network,
# For example, if stats.network=0, then use IP of eth0 as candidate. # For example, if stats.network=0, then use IP of eth0 as candidate.
# @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124 # @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
candidate *; candidate $CANDIDATE;
} }
vhost __defaultVhost__ { vhost __defaultVhost__ {

View file

@ -16,7 +16,7 @@ rtc_media_player: <br>
var PeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection; var PeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
var SessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription || window.webkitRTCSessionDescription; 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 method = "POST";
var shouldBeAsync = true; var shouldBeAsync = true;

View file

@ -4324,6 +4324,11 @@ std::string SrsConfig::get_rtc_candidates()
return eip; 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()); return (conf->arg0().c_str());
} }