diff --git a/internal/core/webrtc_publish_index.html b/internal/core/webrtc_publish_index.html index 74921000..b6b7e865 100644 --- a/internal/core/webrtc_publish_index.html +++ b/internal/core/webrtc_publish_index.html @@ -111,7 +111,7 @@ const setState = (newState) => { const restartPause = 2000; const linkToIceServers = (links) => ( - links.split(', ').map((link) => { + (links !== null) ? links.split(', ').map((link) => { const m = link.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i); const ret = { urls: [m[1]], @@ -124,7 +124,7 @@ const linkToIceServers = (links) => ( } return ret; - }) + }) : [] ); const parseOffer = (offer) => { diff --git a/internal/core/webrtc_read_index.html b/internal/core/webrtc_read_index.html index 3e3a8b6f..0f1a6c1a 100644 --- a/internal/core/webrtc_read_index.html +++ b/internal/core/webrtc_read_index.html @@ -26,8 +26,8 @@ html, body { const restartPause = 2000; const linkToIceServers = (links) => ( - links.split(', ').map((link) => { - const m = link.match(/^<(.+?)>; rel="ice-server"(; username="(.+?)"; credential="(.+?)"; credential-type="password")?/i); + (links !== null) ? links.split(', ').map((link) => { + const m = link.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i); const ret = { urls: [m[1]], }; @@ -39,7 +39,7 @@ const linkToIceServers = (links) => ( } return ret; - }) + }) : [] ); const parseOffer = (offer) => { diff --git a/mediamtx.yml b/mediamtx.yml index ab8c8926..002b97e8 100644 --- a/mediamtx.yml +++ b/mediamtx.yml @@ -199,25 +199,27 @@ webrtcAllowOrigin: '*' # If the server receives a request from one of these entries, IP in logs # will be taken from the X-Forwarded-For header. webrtcTrustedProxies: [] -# List of ICE servers, in format type:user:pass:host:port or type:host:port. +# List of ICE servers, in format type:user:password:host:port or type:host:port. # type can be "stun", "turn" or "turns". -# STUN servers are used to get the public IP of both server and clients. -# TURN/TURNS servers are used as relay when a direct connection between server and clients is not possible. +# STUN servers are used to obtain the public IP of server and clients. They are +# needed when server and clients are on different LANs. +# TURN servers are needed when a direct connection between server and clients +# is not possible. All traffic is routed through the chosen TURN server. # if user is "AUTH_SECRET", then authentication is secret based. -# the secret must be inserted into the pass field. +# the secret must be inserted into the password field. webrtcICEServers: [stun:stun.l.google.com:19302] # List of public IP addresses that are to be used as a host. # This is used typically for servers that are behind 1:1 D-NAT. webrtcICEHostNAT1To1IPs: [] # Address of a ICE UDP listener in format host:port. -# If filled, ICE traffic will come through a single UDP port, +# If filled, ICE traffic will pass through a single UDP port, # allowing the deployment of the server inside a container or behind a NAT. webrtcICEUDPMuxAddress: # Address of a ICE TCP listener in format host:port. -# If filled, ICE traffic will come through a single TCP port, +# If filled, ICE traffic will pass through a single TCP port, # allowing the deployment of the server inside a container or behind a NAT. -# At the moment, setting this parameter forces usage of the TCP protocol, -# which is not optimal for WebRTC. +# Setting this parameter forces usage of the TCP protocol, which is not +# optimal for WebRTC. webrtcICETCPMuxAddress: ###############################################