STUN/TURN in default config

This commit is contained in:
Manuel Araoz 2014-05-05 15:54:17 -03:00
commit 33e824a64c
2 changed files with 21 additions and 14 deletions

View file

@ -9,18 +9,29 @@ var config = {
//host: 'localhost', //host: 'localhost',
//port: 10009, //port: 10009,
//path: '/', //path: '/',
// //
key: 'g23ihfh82h35rf', // api key for the peerjs server key: 'g23ihfh82h35rf', // api key for the peerjs server
host:'162.242.219.26', // peerjs server host: '162.242.219.26', // peerjs server
port:10009, port: 10009,
path: '/', path: '/',
maxPeers: 15, maxPeers: 15,
// debug: 3, debug: 3,
sjclParams: { sjclParams: {
salt: 'mjuBtGybi/4=', // choose your own salt (base64) salt: 'mjuBtGybi/4=', // choose your own salt (base64)
iter:1000, iter: 1000,
mode:'ccm', mode: 'ccm',
ts:parseInt(64), ts: parseInt(64),
},
config: {
'iceServers': [
// Pass in STUN and TURN server for maximum network compatibility
{
url: 'stun:stun.l.google.com:19302'
}, {
url: 'turn:homeo@turn.bistri.com:80',
credential: 'homeo'
}
]
} }
}, },
limits: { limits: {
@ -47,7 +58,6 @@ var config = {
storageSalt: 'mjuBtGybi/4=', // choose your own salt (base64) storageSalt: 'mjuBtGybi/4=', // choose your own salt (base64)
}; };
var log = function () { var log = function() {
if (config.verbose) console.log(arguments); if (config.verbose) console.log(arguments);
} }

View file

@ -28,11 +28,8 @@ function Network(opts) {
mode:'ccm', mode:'ccm',
ts:parseInt(64), ts:parseInt(64),
}; };
this.opts = {};
['config', 'port', 'host', 'path', 'debug', 'key'].forEach(function(k) {
// For using your own peerJs server
self.opts = {};
['port', 'host', 'path', 'debug', 'key'].forEach(function(k) {
if (opts[k]) self.opts[k] = opts[k]; if (opts[k]) self.opts[k] = opts[k];
}); });
this.cleanUp(); this.cleanUp();