Skip to content

Commit 8f75005

Browse files
dignifiedquireflub
andauthored
feat!: introduce iroh-router crate (#2832)
The general goal is to have a single place to deal with custom protocols. ## Breaking Changes - moved - `iroh::node::ProtocolHandler` -> `iroh::router::ProtocolHandler` --------- Co-authored-by: Floris Bruynooghe <flub@n0.computer>
1 parent 67df1c1 commit 8f75005

File tree

18 files changed

+751
-210
lines changed

18 files changed

+751
-210
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ members = [
88
"iroh-test",
99
"iroh-net/bench",
1010
"iroh-cli",
11+
"iroh-router",
1112
]
1213
resolver = "2"
1314

@@ -49,3 +50,4 @@ iroh-base = { path = "./iroh-base" }
4950
iroh-net = { path = "./iroh-net" }
5051
iroh-metrics = { path = "./iroh-metrics" }
5152
iroh-test = { path = "./iroh-test" }
53+
iroh-router = { path = "./iroh-router" }

iroh-router/Cargo.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[package]
2+
name = "iroh-router"
3+
version = "0.27.0"
4+
edition = "2021"
5+
readme = "README.md"
6+
description = "protocol router support for iroh"
7+
license = "MIT OR Apache-2.0"
8+
authors = ["dignifiedquire <me@dignifiedquire.com>", "n0 team"]
9+
repository = "https://github.com/n0-computer/iroh"
10+
keywords = ["quic", "networking", "holepunching", "p2p"]
11+
12+
13+
[dependencies]
14+
anyhow = "1.0.91"
15+
futures-buffered = "0.2.9"
16+
futures-lite = "2.3.0"
17+
futures-util = "0.3.31"
18+
iroh-net = { version = "0.27.0", path = "../iroh-net" }
19+
tokio = "1.41.0"
20+
tokio-util = "0.7.12"
21+
tracing = "0.1.40"
22+
23+
# Examples
24+
clap = { version = "4", features = ["derive"], optional = true }
25+
tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true }
26+
27+
[lints]
28+
workspace = true
29+
30+
31+
[features]
32+
default = []
33+
examples = ["dep:clap", "dep:tracing-subscriber"]
34+
35+
[[example]]
36+
name = "custom-protocol"
37+
required-features = ["examples"]

iroh-router/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# iroh-router
2+
3+
This crate contains the definitions for custom protocols for `iroh`.
4+
5+
# License
6+
7+
This project is licensed under either of
8+
9+
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
10+
http://www.apache.org/licenses/LICENSE-2.0)
11+
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
12+
http://opensource.org/licenses/MIT)
13+
14+
at your option.
15+
16+
### Contribution
17+
18+
Unless you explicitly state otherwise, any contribution intentionally submitted
19+
for inclusion in this project by you, as defined in the Apache-2.0 license,
20+
shall be dual licensed as above, without any additional terms or conditions.

0 commit comments

Comments
 (0)