[package]
name = "iroh"
version = "0.96.1"
edition = "2024"
readme = "README.md"
description = "p2p quic connections dialed by public key"
license = "MIT OR Apache-2.0"
authors = ["dignifiedquire <me@dignifiedquire.com>", "n0 team"]
repository = "https://github.com/n0-computer/iroh"
keywords = ["quic", "networking", "holepunching", "p2p"]
# Sadly this also needs to be updated in .github/workflows/ci.yml
rust-version = "1.89"
[lib]
# We need "cdylib" to actually generate .wasm files when we run with --target=wasm32-unknown-unknown.
# It would be nice if we could make this target-dependent, but we can't (yet): https://github.com/rust-lang/cargo/issues/12260
crate-type = ["lib", "cdylib"]
[lints]
workspace = true
[dependencies]
backon = { version = "1.4" }
bytes = "1.11"
data-encoding = "2.2"
derive_more = { version = "2.0.1", features = ["debug", "display", "from", "try_into", "deref", "from_str", "into_iterator"] }
ed25519-dalek = { version = "3.0.0-pre.1", features = ["serde", "rand_core", "zeroize", "pkcs8", "pem"] }
http = "1"
iroh-base = { version = "0.96.1", default-features = false, features = ["key", "relay"], path = "../iroh-base" }
iroh-relay = { version = "0.96", path = "../iroh-relay", default-features = false }
n0-future = "0.3"
n0-error = "0.1"
n0-watcher = "0.6"
netwatch = { version = "0.14" }
papaya = { version = "0.2.3", default-features = false }
pin-project = "1"
pkarr = { version = "5", default-features = false, features = ["relays"] }
quinn = { package = "iroh-quinn", version = "0.16.1", default-features = false, features = ["rustls-ring"] }
quinn-proto = { package = "iroh-quinn-proto", version = "0.15.1" }
quinn-udp = { package = "iroh-quinn-udp", version = "0.8" }
rand = "0.9.2"
reqwest = { version = "0.12", default-features = false, features = [
"rustls-tls",
"stream",
] }
rustc-hash = "2"
rustls = { version = "0.23.33", default-features = false, features = ["ring"] }
serde = { version = "1.0.219", features = ["derive", "rc"] }
smallvec = "1.11.1"
strum = { version = "0.27", features = ["derive"] }
tokio = { version = "1.44.1", features = [
"io-util",
"macros",
"sync",
"rt",
] }
tokio-stream = { version = "0.1.15", features = ["sync"] }
tokio-util = { version = "0.7", features = ["io-util", "io", "rt"] }
tracing = "0.1"
url = { version = "2.5", features = ["serde"] }
webpki = { package = "rustls-webpki", version = "0.103.7", features = ["ring"] }
webpki_types = { package = "rustls-pki-types", version = "1.12" }
webpki-roots = "1.0.3"
pkcs8 = "0.11.0-rc.9"
# metrics
iroh-metrics = { version = "0.38", default-features = false }
# mdns
swarm-discovery = { version = "0.5", optional = true }
futures-util = "0.3"
# test_utils
axum = { version = "0.8", optional = true }
sync_wrapper = { version = "1.0.2", features = ["futures"] }
# non-wasm-in-browser dependencies
[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dependencies]
hickory-resolver = "0.25.1"
igd-next = { version = "0.16", features = ["aio_tokio"] }
netdev = { version = "0.40.0" }
portmapper = { version = "0.14", default-features = false }
quinn = { package = "iroh-quinn", version = "0.16.1", default-features = false, features = ["runtime-tokio", "rustls-ring"] }
tokio = { version = "1", features = [
"io-util",
"macros",
"sync",
"rt",
"net",
"fs",
"io-std",
"signal",
"process",
] }
# wasm-in-browser dependencies
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies]
wasm-bindgen-futures = "0.4"
# we don't use time directly, but need to enable it because x509_parser uses these in browsers and we need to enable some feature flags for that to work
time = { version = "0.3", features = ["wasm-bindgen"] }
getrandom = { version = "0.3.2", features = ["wasm_js"] }
# target-common test/dev dependencies
[dev-dependencies]
console_error_panic_hook = "0.1"
postcard = { version = "1.1.1", features = ["use-std"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
rand_chacha = "0.9"
chrono = "0.4.43"
# *non*-wasm-in-browser test/dev dependencies
[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dev-dependencies]
axum = { version = "0.8" }
pretty_assertions = "1.4"
rand_chacha = "0.9"
tokio = { version = "1", features = [
"io-util",
"sync",
"rt",
"net",
"fs",
"macros",
"time",
"test-util",
] }
serde_json = "1"
iroh-relay = { path = "../iroh-relay", default-features = false, features = ["test-utils", "server"] }
n0-tracing-test = "0.3"
clap = { version = "4", features = ["derive"] }
tracing-subscriber = { version = "0.3", features = [
"env-filter",
] }
indicatif = { version = "0.18", features = ["tokio"] }
parse-size = { version = "1.1.0", features = ['std'] }
iroh-base = { version = "0.96.1", default-features = false, features = ["key", "relay"], path = "../iroh-base" }
console = { version = "0.16" }
# wasm-in-browser test/dev dependencies
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dev-dependencies]
wasm-tracing = "2.1.0"
wasm-bindgen-test = "0.3"
[build-dependencies]
cfg_aliases = { version = "0.2.1" }
[features]
default = ["metrics", "fast-apple-datapath"]
metrics = ["iroh-metrics/metrics", "iroh-relay/metrics", "portmapper/metrics"]
test-utils = ["iroh-relay/test-utils", "iroh-relay/server", "dep:axum"]
address-lookup-mdns = ["dep:swarm-discovery"]
address-lookup-pkarr-dht = ["pkarr/dht"]
qlog = ["quinn/qlog"]
# Use private Apple APIs to send multiple packets in a single syscall.
fast-apple-datapath = ["quinn/fast-apple-datapath"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "iroh_docsrs"]
test
name = "integration"
path = "tests/integration.rs"
example
name = "listen"
required-features = []
example
name = "connect"
required-features = []
example
name = "listen-unreliable"
required-features = []
example
name = "connect-unreliable"
required-features = []
example
name = "dht_address_lookup"
required-features = ["address-lookup-pkarr-dht"]
example
name = "mdns_address_lookup"
required-features = ["address-lookup-mdns"]
example
name = "search"
required-features = []
example
name = "echo"
required-features = []
example
name = "echo-no-router"
required-features = []
example
name = "transfer"
required-features = []
example
name = "0rtt"
required-features = []