Skip to content

Commit

Permalink
Add quic and dns to the example
Browse files Browse the repository at this point in the history
  • Loading branch information
umgefahren committed Mar 7, 2024
1 parent 5f6f2f6 commit 367273a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions examples/autonatv2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ name = "autonatv2_client"
name = "autonatv2_server"

[dependencies]
libp2p = { workspace = true, features = ["macros", "tokio", "tcp", "noise", "yamux", "autonat",
"identify"]}
libp2p = { workspace = true, features = ["macros", "tokio", "tcp", "noise", "yamux", "autonat", "identify", "dns", "quic"] }
clap = { version = "4.4.18", features = ["derive"] }
tokio = { version = "1.35.1", features = ["macros", "rt-multi-thread"] }
tracing = "0.1.40"
Expand Down
2 changes: 2 additions & 0 deletions examples/autonatv2/src/bin/autonatv2_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ async fn main() -> Result<(), Box<dyn Error>> {
noise::Config::new,
yamux::Config::default,
)?
.with_quic()
.with_dns()?
.with_behaviour(|key| Behaviour::new(key.public(), opt.probe_interval))?
.with_swarm_config(|c| c.with_idle_connection_timeout(Duration::from_secs(10)))
.build();
Expand Down
2 changes: 2 additions & 0 deletions examples/autonatv2/src/bin/autonatv2_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ async fn main() -> Result<(), Box<dyn Error>> {
noise::Config::new,
yamux::Config::default,
)?
.with_quic()
.with_dns()?
.with_behaviour(|key| Behaviour::new(key.public()))?
.with_swarm_config(|c| c.with_idle_connection_timeout(Duration::from_secs(60)))
.build();
Expand Down

0 comments on commit 367273a

Please sign in to comment.