gfodor / p2pcf

Low cost, low effort P2P WebRTC serverless signalling using Cloudflare Workers
MIT License
964 stars 53 forks source link

On a network change, re-create the peer gracefully when it closes #12

Closed gfodor closed 2 years ago

gfodor commented 2 years ago

Instead of forcibly disconnecting all peers on a network change, mark all peers as needing a restart. This results in no forced disconnects in the case of false positives but will also cause the peer to come back online again once it closes. The downside of this is there will be a bunch of dead peers floating around if IPs change benignly and any of the active peers disconnect eventually, since they'll be re-created.