EasyRTC TURN Server with anyfirewall.com

727 views
Skip to first unread message

Jan Meisel

unread,
Feb 11, 2015, 2:36:57 AM2/11/15
to
Hey Guys,

I'm new to EasyRTC, i tried some demos, and it worked well on my own network.
But if I tried it with some friends we've got only a black screen.
after some research i found out it, it's a NAT/Firewall problem.

So I want to use a TURN Server, I decided anyfirewall.com.
So I created a anyfirewall.com account.
And now, I edited my server.js:

// Load required modules                                                        
var http    = require("http");              // http server core module
var express = require("express");           // web framework external module
var io      = require("socket.io");         // web socket external module
var easyrtc = require("easyrtc");           // EasyRTC external module
 
// Setup and configure Express http server. Expect a subfolder called "static" t
o be the web root
.
var httpApp = express();
httpApp
.use(express.static(__dirname + "/static/"));
 
// Start Express http server on port 8080
var webServer = http.createServer(httpApp).listen(8080);
 
// Start Socket.io so it attaches itself to Express server
var socketServer = io.listen(webServer, {"log level":3});

var myIceServers = [
 
{
   
"url":"stun:stun.anyfirewall.com:3478"
  },

 
{
   
"url":"turn:turn.anyfirewall.com:443",
   
"username":"flex*****",
   
"credential":"32M3KsE*****"
 
},
 
{
   
"url":"turn:turn.anyfirewall.com:443?transport=tcp",
   
"username":"flex*****",
   
"credential":"32M3KsE*****"
 
}
];

easyrtc
.setOption("appIceServers", myIceServers);
 
easyrtc
.on("getIceConfig", function(connectionObj, callback){
  callback
(null, myIceServers);
})
 
// Start EasyRTC server
var rtc = easyrtc.listen(httpApp, socketServer);

is something wrong with my server.js file?
I've got at email from anyfirewall.com with a pw. I used it for the credential variable, is this correct?
Should i do some stuff on anyfirewall.com or just sign up?


lg Jan


Eric Davies

unread,
Feb 11, 2015, 1:24:53 PM2/11/15
to eas...@googlegroups.com
It's not quite that simple.

What you need to do is have some code on the server that connects to the anyfirewall.com, passing it your username and password. It then passes you back a credential that you use in your turn server entry. the credential it passes you back is short lived. That way your client side code doesn't see your actual password. The topic has come up before, so you should be able to find some sample code if you look through the past postings (though my search didn't find anything useful).

If you just want life simple and uncomplicated, run your own copy of rfc5766 on a server. 


Reply all
Reply to author
Forward
0 new messages