I’ve seen a few but I can’t decide which protocol to use yet. I’m working on a DHT pet project and I’d like to avoid making it rely on any relay servers.

Thanks in advance for any pointers!

  • Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    English
    arrow-up
    4
    ·
    11 months ago

    If all you want is to break through NAT, you can try a TURN client (rusturn for instance). Unfortunately, STUN/TURN doesn’t solve the entire problem (there are types of NAT that it can’t break through and you need to fall back to full relay mode) but this technology is still used for P2P voice calls all over the place.

    You could consider Veilid, which already handles a lot of DHT stuff. It’s not exactly ultra low latency but it does solve the reachability solution without you having to host any STUN/TURN servers yourself. You can also tweak the protocol a little (either get Tor-like privacy through a whole bunch of intermediate nodes, or just pick two nodes per direction for lower latency).

    I don’t think there’s a Rust crate, but Yggdrasil can also take care of NAT for you while at the same time being exposed like a normal network, so you don’t need to learn a new API.

    There’s libtor that’ll let you embed a Tor client inside your application. Of course Tor is most well-known for privacy and such, but it’s also very effective at busting through any kind of NAT you can imagine.

    Unfortunately, there is no way to get P2P working across the internet without some kind of handshake server, someone needs to tell you where to find the other nodes.