A MOMENT PLEASE...
Don't panic! Existing peer connections will not be affected. You can reconnect to signaller again if:
See the footnote for longer explanation.
NOT CONNECTED TO ANYONE
PeerJS requires an intermediate "signaller" to initiate connection between two peers. Soon after two peers know how to reach each other, the signaller waits for a short time and then disconnect itself. This is to free up resources.
Thus, host and client have to reconnect to signaller again to make themselves discoverable by other peers.
A simple peer-to-peer chat room using PeerJS.
This is a sample project to demonstrate P2P connection using PeerJS and PeerJS Server.
The topology of this application can be classified as a star network where the hosting-peer facilitates all communications between client-peer. Note that hosting-peer is also part of the client-peer so it can participates in the chat.