23 unstable releases

0.12.0 Jan 14, 2025
0.11.1 Aug 10, 2024
0.10.3 May 23, 2024
0.10.2 Dec 9, 2023
0.2.0 Mar 31, 2021

#1796 in Network programming

Download history 69615/week @ 2024-11-22 68422/week @ 2024-11-29 76862/week @ 2024-12-06 73425/week @ 2024-12-13 32674/week @ 2024-12-20 30915/week @ 2024-12-27 57323/week @ 2025-01-03 77560/week @ 2025-01-10 72326/week @ 2025-01-17 74513/week @ 2025-01-24 71596/week @ 2025-01-31 78231/week @ 2025-02-07 82730/week @ 2025-02-14 75619/week @ 2025-02-21 79454/week @ 2025-02-28 61811/week @ 2025-03-07

312,647 downloads per month
Used in 268 crates (6 directly)

MIT license

435KB
8K SLoC

Implementation of the QUIC transport protocol for libp2p.

Usage

Example:

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

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

~21–53MB
~1M SLoC