I want to build a decentralized, reddit-like system using P2P. What existing p2p library should I base it on?

前端 未结 3 1667
无人共我
无人共我 2021-01-31 22:39

I want to build a decentralized, reddit-like system using P2P. Basically, I want to retain the basic capabilities of reddit, but make it decentralized, to make it more robust an

3条回答
  •  清酒与你
    2021-01-31 23:18

    Disclaimer: warning, self-promotion here !!!

    Have you considered JXTA's latest release? It is probably sufficient for what you want to do. Else, we are working on a new P2P framework called Chaupal, but it is not operational yet.

    EDIT

    There is also what I call the quick-and-dirty UDP solution (which is not so dirty after all, I should call it minimal).

    1. Just implement one server with a public address and start listening for UPD.
    2. Peers located behind NATs contact the server which can read how their private IP address has been translated into a public IP address from the received datagrams.
    3. You send that information back to the peer who can forward it to other peers. The server can also help exchanging this information between peers.
    4. Then peers can communicate directly (one-to-one) by sending datagrams to these translated addresses.

    Simple, easy to implement, but does not cover for lost datagrams, replays, out-of-order etc... (i.e., the typical stuff that TCP solves for you at the IP stack level).

提交回复
热议问题