23 releases

0.11.1 Aug 10, 2024
0.10.3 May 23, 2024
0.10.2 Dec 9, 2023
0.10.1 Nov 12, 2023
0.2.0 Mar 31, 2021

#1417 in Network programming

Download history 55979/week @ 2024-07-18 54030/week @ 2024-07-25 50338/week @ 2024-08-01 64328/week @ 2024-08-08 57509/week @ 2024-08-15 58770/week @ 2024-08-22 66064/week @ 2024-08-29 66625/week @ 2024-09-05 62229/week @ 2024-09-12 65187/week @ 2024-09-19 63685/week @ 2024-09-26 74560/week @ 2024-10-03 72550/week @ 2024-10-10 68039/week @ 2024-10-17 67851/week @ 2024-10-24 67295/week @ 2024-10-31

289,665 downloads per month
Used in 219 crates (6 directly)

MIT license

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

~21–55MB
~1M SLoC