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

rustp2p

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

18 releases

new 0.1.18 Dec 5, 2024
0.1.17 Nov 27, 2024
0.1.15 Oct 31, 2024
0.1.6 Sep 23, 2024

#1674 in Network programming

Download history 325/week @ 2024-09-09 7/week @ 2024-09-16 244/week @ 2024-09-23 18/week @ 2024-09-30 861/week @ 2024-10-07 104/week @ 2024-10-14 476/week @ 2024-10-21 249/week @ 2024-10-28 4/week @ 2024-11-04 127/week @ 2024-11-11 22/week @ 2024-11-18 168/week @ 2024-11-25 179/week @ 2024-12-02

497 downloads per month
Used in net_link

Apache-2.0

345KB
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

~5–36MB
~592K SLoC