Support Client-Server architecture
Hello again! Scanning the codebase, from what I can tell netlib assumes a pure peer-to-peer system. This is nice, but I'd like to develop more so client-server style architectures (similar to how geckos.io does it)
However that might lead to a big refactor since you need to do two things
- [ ] Refactor netlib to choose between Peer to Peer or Client-Server
- [ ] Allow for either Hosting on the browser, or hosting in a node.js server (would probably require a polyfill for node-datachannel to work
I'd be down to do a pull request if this isn't something you guys are interested in.
Thinking how this would work, the signaling server/lobby would register one of the peers as the Host, and then the Host would be the only one connected to all the other peers.
Netlib is a peer-to-peer library. Mixing it to also be client-server will not make a great library in both cases. We recommend just using geckos.io in that case. What would make you want to use Netlib for this?
The main thing that netlib has over geckos is seperate datachannels for unreliable/reliable. See https://github.com/geckosio/geckos.io/issues/269 But I understand why that might be scope creep so it’s fair why you wouldn’t want to add such a feature