Open jonasmedeiros opened 8 years ago
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 } ]
signalmaster only supports the shared secret mechanism, not hardcoded usernames and passwords
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.
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.
Is quite easy to solve that only bring it from api.
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 Thanks! Do I need to change anything in the SimpleWebrtc library?
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?
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.
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 } ]