netlib icon indicating copy to clipboard operation
netlib copied to clipboard

Support Client-Server architecture

Open ValorZard opened this issue 5 months ago • 3 comments

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.

ValorZard avatar Jul 23 '25 17:07 ValorZard

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.

ValorZard avatar Jul 23 '25 18:07 ValorZard

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?

erikdubbelboer avatar Jul 24 '25 09:07 erikdubbelboer

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

ValorZard avatar Jul 24 '25 17:07 ValorZard