This was more for fun than real use, but I greatly enjoyed hacking something similar into rqbit bittorrent client.
I wanted to run an instance of 'rqbit download' per torrent via so_reuseport. When a peer tries to connect, it gets sent to a random instance. So I built a whole rendezvous system, where instances find each other & either proxy data to each other or fd pass the socket to each other directly to get the peer socket to the instance that needs it. It uses postcard rpc to chat between instances.
It'd be really neat to have some kind of general peering protocol that different apps could use. This whole exercise was gratuitous as heck, I don't even really intend to use this, but it was a fun path to walk down. So I don't really know what the broader protocol would really be for, what we would use it for. But it seems like such a cool idea! A shared Turso database would probably be a bit more practical than the rpc system, honestly. Ha.
really enjoyed working with rqbit bittorrent client recently, and have been playing with something similar: using so_reuseport (and a single upnp-igd forwarding rule on the home router) to allow multiple
1 comment
[ 6.5 ms ] story [ 19.6 ms ] threadI wanted to run an instance of 'rqbit download' per torrent via so_reuseport. When a peer tries to connect, it gets sent to a random instance. So I built a whole rendezvous system, where instances find each other & either proxy data to each other or fd pass the socket to each other directly to get the peer socket to the instance that needs it. It uses postcard rpc to chat between instances.
It'd be really neat to have some kind of general peering protocol that different apps could use. This whole exercise was gratuitous as heck, I don't even really intend to use this, but it was a fun path to walk down. So I don't really know what the broader protocol would really be for, what we would use it for. But it seems like such a cool idea! A shared Turso database would probably be a bit more practical than the rpc system, honestly. Ha.
https://github.com/rektide/rqbit/tree/peering
really enjoyed working with rqbit bittorrent client recently, and have been playing with something similar: using so_reuseport (and a single upnp-igd forwarding rule on the home router) to allow multiple