Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant make turn server work at my signal master #85

Open
jonasmedeiros opened this issue May 5, 2016 · 10 comments
Open

Cant make turn server work at my signal master #85

jonasmedeiros opened this issue May 5, 2016 · 10 comments

Comments

@jonasmedeiros
Copy link

My configuration bellow is not working can someone help

"turnservers": [
{
"url": "turn:192.158.29.39:3478?transport=udp",
"username": "28224511:1379330808",
"secret": "JZEOEt2V3Qb0y27GRntt2u2PAYA=",
"expiry": 86400
},
{
"url": "turn:192.158.29.39:3478?transport=tcp",
"username": "28224511:1379330808",
"secret": "JZEOEt2V3Qb0y27GRntt2u2PAYA=",
"expiry": 86400
}
]

@jonasmedeiros
Copy link
Author

I have tested at http://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ (say is working fine) with this configurartio is not working with signalmaster

"turnservers": [
{
"url": "turn:numb.viagenie.ca",
"username": "jonas@bdlk.com.br",
"secret": "teste*1A",
"expiry": 86400
}
]

@fippo
Copy link
Contributor

fippo commented May 6, 2016

signalmaster only supports the shared secret mechanism, not hardcoded usernames and passwords

@jonasmedeiros
Copy link
Author

jonasmedeiros commented May 6, 2016

That is a shame, I have take a look to the code and cannot add credential and username, I will explain how I got simpleWebrtc working with the turn server.

I used free turn server, please use it only to test http://numb.viagenie.ca

I have add the configuration directly at the SimpleWebrtc constructor, unfortunately did not use signal master to sove the problem.

var configuration = {
                            "iceServers":[
                              {
                                "url": "stun:stun.l.google.com:19302"
                              },
                              {
                                "url": "turn:numb.viagenie.ca",
                                "username": "your@user.com",
                                "credential": "temp123"
                              }
                            ]
                          };

webrtc = new SimpleWebRTC({
        media: { video: true, audio: true },
        localVideoEl: "#local",
        remoteVideosEl: '',
        nick: "temp",
        autoRequestMedia: true,
        peerConnectionConfig: configuration
      });

To test turn server I added the code bellow, dont forget to take off after test

webrtc.webrtc.config.peerConnectionConfig.iceTransports = "relay";

I have edit SimpleWebrtc and comment the lines bellow so the code wont override my configuration

// connection.on('stunservers', function (args) {
    //     // resets/overrides the config
    //     self.webrtc.config.peerConnectionConfig.iceServers = args;
    //     self.emit('stunservers', args);
    // });

Tu run the new javascript I went to terminal.

npm install
node build
node build.js

add the code to my project, after all this is working without signal master, signal master should make it work with the normal configuration, would be easier.

@fippo
Copy link
Contributor

fippo commented May 6, 2016

the problem with this method is that your credentials are exposed to javascript and anyone can grab them from there. The shared secret method limits the risk of this.

@jonasmedeiros
Copy link
Author

Is quite easy to solve that only bring it from api.

@dockiem
Copy link

dockiem commented Nov 6, 2017

hi Fippo, you mentioned:

signalmaster only supports the shared secret mechanism, not hardcoded usernames and passwords

Where and how (as in the code) exactly it's doing that? What if my TURN server doesn't support that secret mechanism? How do I turn that feature off?
Thank you so much!

@fippo
Copy link
Contributor

fippo commented Nov 6, 2017

@dockiem change what gets passed here

@dockiem
Copy link

dockiem commented Nov 6, 2017

@fippo Thanks! Do I need to change anything in the SimpleWebrtc library?

@dockiem
Copy link

dockiem commented Nov 7, 2017

hi @fippo , I replaced that line with this:

client.emit('turnservers', config.credentials || []);

But the TURN server credentials are not returned back to the browser. What did I do wrong?

@vinodmap
Copy link

I modified my scokets.js in my signalmaster with these lines:

credentials.push({        
username: config.turnservers[0].username,
credential: config.turnservers[0].password,
urls: config.turnservers[0].urls[0]
});
client.emit('turnservers', credentials);

Mine works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants