Long delay before "Go private" button is enabled
draeder opened this issue · 2 comments
Running this on localhost in two browser tabs. The "Go private" button does not enable in a timely fashion, sometimes taking up to a minute or more.
That was just an example, you can enable that by yourself as follows:
const p2p = new P2P(socket);
setInterval(function(){
if (p2p.usePeerConnection === true){
// now the connection is established and ready
}else{
// the connection is not ready yet
}
}, 1000);
For future readers: Remove the "trickle" parameter from the constructor in the chat example. That is what is done in the example above -> By only passing the socket the SocketIOp2p constructor, the default params are 5 clients, and autoUpgrade: true
. So as soon as clients can connect to eachother they are "upgraded" to webRTC. I am not sure what the trickle parameter is... could find the documentation yet