Implementing our own STUN/TURN server for WebRTC Application [duplicate]

TURN it’s an extension of STUN, so TURN server has also STUN features. https://code.google.com/p/rfc5766-turn-server/ works also as a STUN, so you can try to write something like this: var pc_config = { “iceServers”: [{ “url”:”turn:my_username@<turn_server_ip_address>”, “credential”:”my_password” }] }; pc_new = new webkitRTCPeerConnection(pc_config);

WebRTC – How many STUN/TURN servers do I need to specify?

A STUN server is used to get an external network address. TURN servers are used to relay traffic if direct (peer to peer) connection fails. URLs for STUN and/or TURN servers are (optionally) specified by a WebRTC app in the iceServers configuration object that is the first argument to the RTCPeerConnection constructor. example of using … Read more

Java UDP hole punching example – connecting through firewall

This example is in C#, not in Java, but the concepts of NAT traversal are language-agnostic. See Michael Lidgren’s network library which has NAT traversal built in. Link: http://code.google.com/p/lidgren-network-gen3/ Specific C# File Dealing with NAT Traversal: http://code.google.com/p/lidgren-network-gen3/source/browse/trunk/Lidgren.Network/NetNatIntroduction.cs The process you’ve posted is correct. It will work, for only 3 out of 4 general types of … Read more

STUN/TURN server connectivity test

Edit: A nice implementation in github.io 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

How does WebRTC work?

WebRTC gives SDP Offer to the client JS app to send (however the JS app wants) to the other device, which uses that to generate an SDP Answer. The trick is that the SDP includes ICE candidates (effectively “try to talk to me at this IP address and this port”). ICE works to punch open … Read more