question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Works even if the TURN server credentials are wrong

See original GitHub issue

The following code logs the offer text but shouldn’t it give an error because the turn server doesn’t exist? Is there a fallback server which the app connects to if the turn server is not found?

const wrtc = require('wrtc');
const Peer = require('simple-peer');

const turnServer = {
    urls: 'turn:fake.address:3478',
    username: 'u',
    credential: 'c'
}
const peer1 = new Peer({ 
    initiator: true, 
    wrtc: wrtc, 
    config: { iceServers: [ turnServer ] }
})

peer1.on('signal', function (data) {
    console.log(JSON.stringify(data));
})

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
t-mullencommented, May 24, 2018

The offer is generated client side. The client takes the information you give it and puts it into a format (SDP) to send over the signalling channel. It doesn’t connect to any servers during this process*.

Once signalling is complete, the peers will connect directly if they are on the same local network, try to use STUN if they’re not, and then use TURN if STUN fails. So if your TURN server doesn’t exist and STUN works, the peers will never even notice. Likewise, a bad STUN server won’t be contacted if the peers are on the same local network or machine.

*Aside from ICE candidate gathering without trickle, but if the server is unreachable, it will just be skipped.

1reaction
t-mullencommented, May 24, 2018

The offer should be shorter and generate without an error. You’d get a ice failure during connection, unless I’ve made some mistake about the behaviour iceTransportPolicy: 'relay' .

Yes, normal as in using STUN. You can add your own STUN server. You shouldn’t get an error in that code either.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is Numb Turn server not working or are my configurations ...
It seems as though the Numb TURN servers do not actually work. No idea why. But they do show up in the WebRTC...
Read more >
wrong user account while user is defined in the config file
Hi,. I am trying to run a TURN server on my CentOS 6.5 virtual machine using putty and the installation and everything went...
Read more >
Cannot find credentials of user (Opera) - My turn server broken
Opera = Is Turn Server Active = NO! I Using simplewebrtc and signalmaster = it works fine. But I can not get broadcast...
Read more >
webrtcbin Issue in turn-server property - Freedesktop GitLab
The turn-server credentials is not being parsed properly in webrtcbin. The issue is happening in the following cases mainly:.
Read more >
Troubleshooting TURN - Giacomo Vacca
If the STUN Binding Request is received by the TURN server, ... In case of wrong credentials, instead of an Allocate Success Response...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found