2

I am follwing this http://www.html5rocks.com/en/tutorials/webrtc/infrastructure tutorial. This tutorial or discussion is about TURN/STUN servers. And this tutorial add turn and stun server code like below.

{
  'iceServers': [
    {
      'url': 'stun:stun.l.google.com:19302'
    },
    {
      'url': 'turn:192.158.29.39:3478?transport=udp',
      'credential': 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
      'username': '28224511:1379330808'
    },
    {
      'url': 'turn:192.158.29.39:3478?transport=tcp',
      'credential': 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
      'username': '28224511:1379330808'
    }
  ]
}

Can i use this credentials to make Web-RTC communication between browsers (on different pcs).

And ı read this tutorial also Implementing our own STUN/TURN server for WebRTC Application. According to this tutorial when we use turn server for nat and firewalls, using stun server is unnecessary. And this tutorial added this code for stun and turn server.

var pc_config = {"iceServers": [{"url":"turn:my_username@<turn_server_ip_address>", "credential":"my_password"}]};

pc_new = new webkitRTCPeerConnection(pc_config);

What is "turn_server_ip_address" or what is "my_password" ? how can ı know this credential ?

Community
  • 1
  • 1
Dvlpr
  • 453
  • 3
  • 8
  • 20

1 Answers1

4

those credentials provided in the examples are EXAMPLES, you cannot use them in a product.

Most TURN servers require credentials to utilize because of the possible high network usage because of relaying the SRTP/SRTCP packets. STUN servers on the other hand are usually not protected as there is not much computing power or network utilization when using them for candidate gathering.

There are open turn servers(NUMB for example, you can set up a username and password to use against their servers) out there that you can test against but I would suggest creating your own in some sort of cloud computing service if you are creating a product.

In short, you know the credentials and IP address of the TURN server because either you signed up for the service you are using or it is your server.

Benjamin Trent
  • 7,378
  • 3
  • 31
  • 41
  • Benjamin, i am using one application. When ı ran server and two client on 3 computer, remote video is black. But when ı ran this application on two computer remote video is shown. The application has stun server but it hasn't got turn server. So that ı try to add turn server. I shared this error this 'http://stackoverflow.com/questions/25402937/webrtc-remote-video-is-shown-as-black-on-three-diffrerent-computers' tutorial link. What can be errors? – Dvlpr Aug 22 '14 at 13:08
  • This has nothing to do with STUN/TURN but with how you are handling the peerconnections. If those are the actual values you are using, they do nothing and do not gather any candidates as they are not valid servers or credentials. However, if you are behind the same NAT, it does not matter if they are valid or not because they are not needed. – Benjamin Trent Aug 22 '14 at 15:14
  • I use computers on the same network ? Am i behind the same NAT ? – Dvlpr Aug 22 '14 at 15:16
  • then your black screens have nothing to do with STUN or TURN settings. – Benjamin Trent Aug 22 '14 at 15:18