2

I am working with ProjectRTC and I successfully tested it with Firefox and the android client. I put the server code on a remote server(digitalocean), accessing through my home pc.

However, everything works fine until I test it using a home ADSL, or (slower) ADSL for the pc with Firefox and a 3G/4G Network for the Android client.

If I use a 3G/4G network for my pc through my mobile (using the hotspot option), it tries to connect to the client but I get the error "Ice Failed" on the javascript console.

I tried to add a TURN client on

public/javascripts/rtcClient.js

adding this:

var localId,
config = {
  peerConnectionConfig: {
    iceServers: [

      /*test*/
      {
        "username":"e7db750a-2fcc-40c6-8415-cab22743a68a",
        "url": "turn:turn1.xirsys.com:443?transport=tcp",
        "credential":"287ae254-9380-4f81-af88-e1cc9ed27eb0"
      },

      {
        "username":"e7db750a-2fcc-40c6-8415-cab22743a68a",
        "url": "turn:turn1.xirsys.com:443?transport=udp",
        "credential":"287ae254-9380-4f81-af88-e1cc9ed27eb0"
      },
      /*end test*/

      {
      "url": "stun:stun.l.google.com:19305"
      }
  ]
  },
  peerConnectionConstraints: {
    optional: [{
      "DtlsSrtpKeyAgreement": true,
    }]
  }
},

peerDatabase = {},
localStream,
remoteVideoContainer = document.getElementById('remoteVideosContainer'),
socket = io();

socket.on('message', handleMessage);
socket.on('id', function(id) {
localId = id;
});

but I still got no luck, getting again "ICE failed".

I also tried to read this, but I don't think it's what I'm searching for. Do you have any idea to get this to work with mobile connections?

Thanks in advance for your interest!

Community
  • 1
  • 1
Don Diego
  • 1,309
  • 3
  • 23
  • 46

1 Answers1

0

Don't hardcode your ICE string. The XirSys ICE string is time sensitive and will expire after 30 seconds. You need to request a fresh ICE string for each connection. This may fix your issue or may not, but it will at least rule out the ICE string as being the problem.

Regards, Lee

Lee Sylvester
  • 183
  • 1
  • 7
  • thanks, I just followed this tutorial: http://xirsys.com/guide/ that says: This token should only be implemented in a secure environment, such as a server-side application or a compiled client-side application. Failure to do this will result in unwanted users hijacking your TURN bandwidth and other security flaws. However, for simplicity’s sake, we’re going to break that rule just this once and initiate a WebRTC connection from the client-side through a jQuery POST request. so the idea was to put things in order when it will work! However, I tried but no luck =( – Don Diego May 05 '16 at 10:09