How to addTrack in MediaStream in WebRTC

Update: working example near bottom. This depends greatly on which browser you are using at the moment, due to an evolving spec. In the specification and Firefox, peer connections are now fundamentally track-based, and do not depend on local stream associations. You have var sender = pc.addTrack(track, stream), pc.removeTrack(sender), and even sender.replaceTrack(track), the latter involving … Read more

STUN/TURN server connectivity test

Edit: A nice implementation in taken from comment to another answer( choose “relay” in IceTransports value): Test TURN Server following Benjamin Trent’s advice, I wrote the below code to test TURN server’s connectivity, works on both firefox n chrome: function checkTURNServer(turnConfig, timeout){ return new Promise(function(resolve, reject){ setTimeout(function(){ if(promiseResolved) return; resolve(false); promiseResolved = true; }, … Read more

RTCIceCandidate no longer returning IP

Chrome is not broken, the WebRTC standard is evolving to prevent sites from collecting local addresses by diverting the WebRTC API. If you used this hack to obtain local addresses, you might need to find another approach. Here are the corresponding issues for Chromium and Firefox, and the current IETF draft for WebRTC mDNS candidates.

Can I simplify WebRTC signalling for computers on the same private network?

STUN/TURN is different from signaling. STUN/TURN in WebRTC are used to gather ICE candidates. Signaling is used to transmit between these two PCs the session description (offer and answer). You can use free STUN server (like or There are also free TURN servers, but not too many (these are resource expensive). One is … Read more

Why is a signaling server needed for WebRTC?

WebRTC doesn’t solve discovery (nor should it). WebRTC knows how to talk directly to another peer without a signaling server, but it doesn’t know how to discover another peer. Discovery is an inherent problem, so I’m a bit baffled that people expect WebRTC to solve it for them. Think about it: How are you going … Read more