diff --git a/protocols/autonat/Cargo.toml b/protocols/autonat/Cargo.toml index 48903f88781..07e83adb066 100644 --- a/protocols/autonat/Cargo.toml +++ b/protocols/autonat/Cargo.toml @@ -41,3 +41,11 @@ libp2p-yamux = { path = "../../muxers/yamux" } all-features = true rustdoc-args = ["--cfg", "docsrs"] rustc-args = ["--cfg", "docsrs"] + +[[example]] +name = "client" +path = "examples/autonat_client.rs" + +[[example]] +name = "server" +path = "examples/autonat_server.rs" diff --git a/protocols/autonat/examples/autonat_client.rs b/protocols/autonat/examples/autonat_client.rs index 2932b8350ce..d2a7b2dee2f 100644 --- a/protocols/autonat/examples/autonat_client.rs +++ b/protocols/autonat/examples/autonat_client.rs @@ -116,6 +116,7 @@ impl Behaviour { refresh_interval: Duration::from_secs(30), boot_delay: Duration::from_secs(5), throttle_server_period: Duration::ZERO, + only_global_ips: false, ..Default::default() }, ), diff --git a/protocols/autonat/examples/autonat_server.rs b/protocols/autonat/examples/autonat_server.rs index 68735bf23d3..8163826c830 100644 --- a/protocols/autonat/examples/autonat_server.rs +++ b/protocols/autonat/examples/autonat_server.rs @@ -95,7 +95,10 @@ impl Behaviour { )), auto_nat: autonat::Behaviour::new( local_public_key.to_peer_id(), - autonat::Config::default(), + autonat::Config { + only_global_ips: false, + ..Default::default() + }, ), } }