peerjs icon indicating copy to clipboard operation
peerjs copied to clipboard

connection problem

Open ioeti opened this issue 1 year ago • 3 comments

Using this on work software https://cloudio.tangramerp.com/communicator4.html?id=donkey where id=.... just forces a userID.... I encounter the following issue :

server loaded page connects to another user, but as soon we sent data the connection disconnects. But this at moment just with one user. The same page loaded locally at the same user works perfect in his network.

( So I do not think there is a problem with Why am I unable to connect? You could be behind a symmetric NAT, in which case you'll need to set up a TURN server. Another possible issue is your network blocking port 443, which the PeerServer cloud runs on. In this you must use your own PeerServer running on an appropriate port instead of the cloud service. )

with my testings local to local, local to server, server to server , both using the same network as well as different networks ( mobile phone and lan ) I could not obtain this issue. (video call still in building, will not work)

Any idea ?

Regards ..a wonderful piece of Software...by the way. Claudio Klemp

ioeti avatar Dec 28 '23 21:12 ioeti

This is an issue I am facing too. But this doesn't happen always, it happens only in some situations as mentioned by you. This didn't used to happen earlier, I guess this is some bug introduced by mistake either in peerjs library or webrtc in general, or possibly it may be because of this.

SahilAggarwal2004 avatar Jan 02 '24 16:01 SahilAggarwal2004

I believe @SahilAggarwal2004 is correct; this issue could be related to TURN.

When two Peers are behind a strict firewall or NAT, they can't communicate with each other directly and require a server to relay their data. Up until a few weeks ago, we maintained a free TURN server on a best-effort basis to prevent these connections from failing. However, since we had to discontinue this service, these specific connections will fail unless a TURN server URL is configured on the client.

In the linked post there’s both a service and a software for self-hosting mentioned. Please try them out, and if there are still problems with a working TURN setup, we can investigate further.

jonasgloning avatar Jan 02 '24 20:01 jonasgloning

I believe @SahilAggarwal2004 is correct; this issue could be related to TURN.

When two Peers are behind a strict firewall or NAT, they can't communicate with each other directly and require a server to relay their data. Up until a few weeks ago, we maintained a free TURN server on a best-effort basis to prevent these connections from failing. However, since we had to discontinue this service, these specific connections will fail unless a TURN server URL is configured on the client.

In the linked post there’s both a service and a software for self-hosting mentioned. Please try them out, and if there are still problems with a working TURN setup, we can investigate further.

If I add the turn server configuration using the config property, will it replace the default configuration or append the config in default configuration?

SahilAggarwal2004 avatar Jan 09 '24 15:01 SahilAggarwal2004