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

rustp2p

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

19 releases

new 0.2.0 Feb 21, 2025
0.1.18 Dec 5, 2024
0.1.17 Nov 27, 2024
0.1.15 Oct 31, 2024
0.1.6 Sep 23, 2024

#1629 in Network programming

Download history 238/week @ 2024-10-29 3/week @ 2024-11-05 134/week @ 2024-11-12 15/week @ 2024-11-19 171/week @ 2024-11-26 177/week @ 2024-12-03 19/week @ 2024-12-10 115/week @ 2024-12-17 19/week @ 2024-12-24 276/week @ 2025-02-04 30/week @ 2025-02-11

306 downloads per month
Used in 2 crates

Apache-2.0

350KB
9K 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).

Example

Dependencies

~6–37MB
~584K SLoC