Skip to content

Commit 42cc194

Browse files
authored
chore: update examples to iroh v0.29.0 (#99)
1 parent 62af5c2 commit 42cc194

File tree

24 files changed

+3883
-3987
lines changed

24 files changed

+3883
-3987
lines changed

dumbpipe-web/Cargo.lock

Lines changed: 394 additions & 829 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dumbpipe-web/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ license = "Apache-2.0/MIT"
1010
anyhow = "1.0.75"
1111
bytes = "1.5.0"
1212
clap = { version = "4.4.11", features = ["derive"] }
13-
dumbpipe = "0.20"
13+
dumbpipe = "0.21"
1414
http = "1.0.0"
1515
http-body-util = "0.1.0"
1616
hyper = { version = "1.0.1", features = ["full"] }
1717
hyper-util = { version = "0.1.1", features = ["full"] }
18-
iroh = "0.28"
18+
iroh = "0.29"
1919
iroh-quinn = "0.12.0"
2020
tokio = { version = "1.34.0", features = ["full"] }
2121
tracing = "0.1.40"

dumbpipe-web/src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ use hyper::service::service_fn;
1414
use hyper::{Request, Response};
1515

1616
use hyper_util::rt::TokioIo;
17-
use iroh::net::key::SecretKey;
18-
use iroh::net::{AddrInfo, Endpoint, NodeAddr};
17+
use iroh::{key::SecretKey, AddrInfo, Endpoint, NodeAddr};
1918
use tokio::net::TcpListener;
2019

2120
#[derive(Parser, Debug)]
@@ -65,7 +64,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
6564
// Create a iroh endpoint and set it as a global
6665
//
6766
// Done explicitly here because creation is async
68-
let mut builder = Endpoint::builder().secret_key(secret_key);
67+
let mut builder = Endpoint::builder().secret_key(secret_key).discovery_n0();
6968
if let Some(addr) = args.iroh_ipv4_addr {
7069
builder = builder.bind_addr_v4(addr);
7170
}
@@ -112,7 +111,7 @@ fn bad_request(text: &'static str) -> anyhow::Result<Response<BoxBody<Bytes, hyp
112111

113112
fn parse_subdomain(subdomain: &str) -> anyhow::Result<NodeAddr> {
114113
// first try to parse as a node id
115-
if let Ok(node_id) = iroh::net::NodeId::from_str(subdomain) {
114+
if let Ok(node_id) = iroh::NodeId::from_str(subdomain) {
116115
return Ok(NodeAddr {
117116
node_id,
118117
info: AddrInfo {

0 commit comments

Comments
 (0)