mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-25 15:51:34 +00:00
Configurable multistream-select protocol. Add V1Lazy variant. (#1245)
Make the multistream-select protocol (version) configurable on transport upgrades as well as for individual substreams. Add a "lazy" variant of multistream-select 1.0 that delays sending of negotiation protocol frames as much as possible but is only safe to use under additional assumptions that go beyond what is required by the multistream-select v1 specification.
This commit is contained in:
@ -36,7 +36,7 @@
|
||||
//! Example:
|
||||
//!
|
||||
//! ```
|
||||
//! use libp2p_core::{identity, Transport};
|
||||
//! use libp2p_core::{identity, Transport, upgrade};
|
||||
//! use libp2p_tcp::TcpConfig;
|
||||
//! use libp2p_noise::{Keypair, X25519, NoiseConfig};
|
||||
//!
|
||||
@ -44,7 +44,7 @@
|
||||
//! let id_keys = identity::Keypair::generate_ed25519();
|
||||
//! let dh_keys = Keypair::<X25519>::new().into_authentic(&id_keys).unwrap();
|
||||
//! let noise = NoiseConfig::xx(dh_keys).into_authenticated();
|
||||
//! let builder = TcpConfig::new().upgrade().authenticate(noise);
|
||||
//! let builder = TcpConfig::new().upgrade(upgrade::Version::V1).authenticate(noise);
|
||||
//! // let transport = builder.multiplex(...);
|
||||
//! # }
|
||||
//! ```
|
||||
|
Reference in New Issue
Block a user