-
Notifications
You must be signed in to change notification settings - Fork 93
Peers get disconnected when signalling server is stopped #453
Comments
I'm still blocked by this problem, would you have any pointer as to how to solve this @achingbrain ? |
I've done a little digging into this, it looks like we receive an error event when the signalling server goes away, which then causes us to close the listener and tear down the connections. It should be more fault tolerant - if the signalling server disconnects the listener should: a) try to reconnect |
Tweaks the logic around server errors so that if we lose our connection to the sigserver, we now let socket.io's reconnection logic handle trying to reconnect instead of tearing everything down. Fixes: #453
## [@libp2p/webrtc-star-signalling-server-v2.0.4](https://github.com/libp2p/js-libp2p-webrtc-star/compare/@libp2p/webrtc-star-signalling-server-v2.0.3...@libp2p/webrtc-star-signalling-server-v2.0.4) (2022-09-21) ### Bug Fixes * do not close connections when sigserver goes away ([#456](#456)) ([206bdd5](206bdd5)), closes [#453](#453)
🎉 This issue has been resolved in version @libp2p/webrtc-star-signalling-server-v2.0.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version @libp2p/webrtc-star-v3.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
0.37.3
3.0.0
v103.0.5060.66
and88.0.4412.53
)Severity: High
Description:
We are trying to create a peer-to-peer web application using libp2p to enable browsers to communicate.
As such, we used the example named libp2p-in-the-browser as a starting point.
In this example, peers discover and connect to each others using provided webrtc-star signalling servers and bootstrap nodes.
In order to setup our own network, we use our own webrtc-star signalling server and do not use bootstrap nodes anymore.
In this configuration, we discovered that peers get disconnected if the signalling server is shutdown afterward.
Following what is explained regarding the network topology in this issue, we thought that browsers were communicating directly with each others using webrtc channels once the network is setup.
As such, we thought that the webrtc-star signalling server was not required anymore once peers were connected.
We were able to reproduce this issue with the latest versions of libp2p and webrtc-star.
In order to find potential issues in our code, we tried projects from the community, notably https://github.com/svdo/js-libp2p-example-chat-in-the-browser.
This project used former versions of libp2p (0.27.7) and webrtc-star (0.17.3).
We edited its code to use our own signalling server and disable discovery using bootstrap nodes.
This time, nodes were still connected and able to communicate when we shutdown the signalling server.
It thus appears that some changes from these versions to nowadays made the signalling server the center and the single point of failure of the network topology.
Steps to reproduce the error:
The following repository provides the code and instructions to reproduce the issue: https://github.com/BaptisteHubert/libp2p-webrtc-star-issue.
The text was updated successfully, but these errors were encountered: