20 unstable releases (9 breaking)

0.10.2 Dec 9, 2023
0.10.1 Nov 12, 2023
0.9.3 Oct 18, 2023
0.9.0-alpha Jul 31, 2023
0.2.0 Mar 31, 2021

#2095 in Network programming

Download history 43029/week @ 2024-01-22 43965/week @ 2024-01-29 47368/week @ 2024-02-05 47218/week @ 2024-02-12 55571/week @ 2024-02-19 51415/week @ 2024-02-26 47850/week @ 2024-03-04 50335/week @ 2024-03-11 54966/week @ 2024-03-18 52848/week @ 2024-03-25 65068/week @ 2024-04-01 62611/week @ 2024-04-08 56483/week @ 2024-04-15 54672/week @ 2024-04-22 46845/week @ 2024-04-29 44513/week @ 2024-05-06

204,491 downloads per month
Used in 191 crates (4 directly)

MIT license

445KB
8K SLoC

Implementation of the QUIC transport protocol for libp2p.

Usage

Example:

#
#
use libp2p_quic as quic;
use libp2p_core::{Multiaddr, Transport, transport::ListenerId};

let keypair = libp2p_identity::Keypair::generate_ed25519();
let quic_config = quic::Config::new(&keypair);

let mut quic_transport = quic::async_std::Transport::new(quic_config);

let addr = "/ip4/127.0.0.1/udp/12345/quic-v1".parse().expect("address should be valid");
quic_transport.listen_on(ListenerId::next(), addr).expect("listen error.");
#

The GenTransport struct implements the libp2p_core::Transport. See the documentation of libp2p_core and of libp2p in general to learn how to use the Transport trait.

Note that QUIC provides transport, security, and multiplexing in a single protocol. Therefore, QUIC connections do not need to be upgraded. You will get a compile-time error if you try. Instead, you must pass all needed configuration into the constructor.

Dependencies

~20–56MB
~1M SLoC