socket.io-p2p icon indicating copy to clipboard operation
socket.io-p2p copied to clipboard

Long delay before "Go private" button is enabled

Open draeder opened this issue 5 years ago • 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.

draeder avatar Jun 27 '19 00:06 draeder

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);

AdamSEY avatar Feb 26 '20 19:02 AdamSEY

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

twofingerrightclick avatar Nov 05 '20 19:11 twofingerrightclick