Getting error of id undefined.
If I use 0.peerjs.com
it works just fine.
This is the client side code :
var peer = new Peer({
host: 'vchat247.hopto.org',
port: 9000,
path: '/peer/',
debug: 3,
config: {
'iceServers': [
{url: 'stun:stun1.l.google.com:19302'},
{
url: 'turn:numb.viagenie.ca',
credential: 'muazkh', username: 'webrtc@live.com'
}
]
}
});
And here is my own peer-server
code :
var fs = require('fs');
var PeerServer = require('peer').PeerServer;
var server = PeerServer({
port: 9000,
path: '/peer/',
ssl: {
key: fs.readFileSync('./myserver.key'),
certificate: fs.readFileSync('./vchat247.hopto.org.crt')
}
});
What am I doing wrong?
And if I use this code :
function randomString(length, chars) {
var result = '';
for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
return result;
}
var peer = new Peer(randomString(16, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), {host: 'vchat247.hopto.org', port: 9000, path: '/peer/'});
Apparently, I get an id, but after a while, this is the browser console result :
Thanks in advance :)