mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-23 23:01:33 +00:00
protocols/: Implement Direct Connection Upgrade through Relay (DCUtR) (#2438)
Enables two peers to coordinate a hole punch (direct connection upgrade) via a relayed connection. See https://github.com/libp2p/specs/blob/master/relay/DCUtR.md for specification.
This commit is contained in:
@ -25,6 +25,8 @@
|
||||
//!
|
||||
//! See `examples` directory for more.
|
||||
|
||||
#[cfg(feature = "dcutr")]
|
||||
mod dcutr;
|
||||
#[cfg(feature = "gossipsub")]
|
||||
mod gossipsub;
|
||||
#[cfg(feature = "identify")]
|
||||
@ -41,6 +43,8 @@ use prometheus_client::registry::Registry;
|
||||
|
||||
/// Set of Swarm and protocol metrics derived from emitted events.
|
||||
pub struct Metrics {
|
||||
#[cfg(feature = "dcutr")]
|
||||
dcutr: dcutr::Metrics,
|
||||
#[cfg(feature = "gossipsub")]
|
||||
gossipsub: gossipsub::Metrics,
|
||||
#[cfg(feature = "identify")]
|
||||
@ -66,6 +70,8 @@ impl Metrics {
|
||||
pub fn new(registry: &mut Registry) -> Self {
|
||||
let sub_registry = registry.sub_registry_with_prefix("libp2p");
|
||||
Self {
|
||||
#[cfg(feature = "dcutr")]
|
||||
dcutr: dcutr::Metrics::new(sub_registry),
|
||||
#[cfg(feature = "gossipsub")]
|
||||
gossipsub: gossipsub::Metrics::new(sub_registry),
|
||||
#[cfg(feature = "identify")]
|
||||
|
Reference in New Issue
Block a user