Is Numb Turn server not working or are my configurations wrong?

Viewed 336

I am using the free TURN server provided by https://numb.viagenie.ca/. The STUN servers are also public.

I am using the following configuration:

const iceConfiguration = {
    iceServers: [
        {
            url: 'stun:stun.stunprotocol.org'
        },
        {
            url: 'stun:stun.sipgate.net:10000'
        },
        {
            url: 'turn:numb.viagenie.ca',
            credential: 'mypassword',
            username: 'myemail'
        }
    ]
}

I create an offer, send it to the other peer (different NAT) and then attempt to set the remote description with the answer. Upon calling myConnection.setRemoteDescription(answer), it keeps pending indefinitely and does not get resolved. Also, the remote peer can set its remote description without any issues. It all works fine for devices in the same network. So, I guess the problem lies in the relay server.

If so, should I ditch the public Numb server and opt towards using Coturn with DigitalOcean hosting or am I doing something totally wrong here?

2 Answers

Before setting up a brand new TURN server you can try to understand what's actually happening: if you take a trace on the computer with an application like Wireshark, and filter for stun messages, you should be able to see the browser sending Binding Request and Allocate Request methods towards the TURN server.

A missing response from the server may mean that the server is not available, the port is wrong, or a firewall prevents the browser to reach the TURN server.

If instead the credentials are wrong, the browser will receive a 401 error to the Allocate Request with the message-integrity attribute.

You can also verify the TURN URL and credentials by running the WebRTC sample application that deals with ICE candidate gathering at https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ .

It seems as though the Numb TURN servers do not actually work. No idea why. But they do show up in the WebRTC trickle ICE sample application.

Related