#peer #nat #connect #hole #p2p #configuration #hole-punching

rustp2p

A decentralized p2p library powered by Rust, which is devoted to simple use

5 releases

new 0.1.5 Sep 14, 2024
0.1.4 Sep 14, 2024
0.1.3 Sep 14, 2024
0.1.2 Sep 14, 2024
0.1.1 Sep 14, 2024

#1804 in Network programming

Download history 325/week @ 2024-09-09

325 downloads per month

Apache-2.0

255KB
6.5K SLoC

A decentralized p2p library powered by Rust, which is devoted to simple use.

Crates.io rustp2p

Features

  1. UDP hole punching for both Cone and Symmetric Nat
  2. TCP hole punching for NAT1

Description

For connecting two peers, all you need to do is to give the configuration as done in the example. In short, provide a peer named C, peer A and B can directly connect to C, then A and B will find each other by C, A and C can directly connect by hole-punching, the whole process is done by this library. If two peers D and F cannot directly connect via hole-punching, this library can find the best link for indirectly connection(i.e. through some middle nodes).

Dependencies

~7–16MB
~193K SLoC