You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: protocols/rpc.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,7 +169,7 @@ But we said that we wanted to be able to seamlessly switch between remote or loc
169
169
```rust
170
170
enumClient {
171
171
Local(mpsc::Sender<FullRequest>),
172
-
Remote(quinn::Connection),
172
+
Remote(noq::Connection),
173
173
}
174
174
175
175
implClient {
@@ -206,7 +206,7 @@ But what about all this boilerplate?
206
206
207
207
**The `irpc` crate is meant solely to reduce the tedious boilerplate involved in writing the above manually.**
208
208
209
-
It does *not* abstract over the connection type - it only supports [iroh-quinn] send and receive streams out of the box, so the only two possible connection types are `iroh` p2p QUIC connections and normal QUIC connections. It also does not abstract over the local channel type - a local channel is always a `tokio::sync::mpsc` channel. Serialization is always using postcard and length prefixes are always postcard varints.
209
+
It does *not* abstract over the connection type - it only supports [noq] QUIC send and receive streams out of the box, so the only two possible connection types are `iroh` p2p QUIC connections and normal QUIC connections. It also does not abstract over the local channel type - a local channel is always a `tokio::sync::mpsc` channel. Serialization is always using postcard and length prefixes are always postcard varints.
210
210
211
211
So let's see what our kv service looks like using `irpc`:
212
212
@@ -286,8 +286,8 @@ converting the result into a futures `Stream` or the updates into a futures
286
286
services that can be used in-process or across processes, not to provide an
287
287
opinionated high level API.
288
288
289
-
For stream based rpc calls, there is an issue you should be aware of. The quinn
290
-
`SendStream` will send a finish message when dropped. So if you have a finite
289
+
For stream based rpc calls, there is an issue you should be aware of. The noq
290
+
QUIC `SendStream` will send a finish message when dropped. So if you have a finite
291
291
stream, you might want to have an explicit end marker that you send before
292
292
dropping the sender to allow the remote side to distinguish between successful
293
293
termination and abnormal termination. E.g. the `SetFromStream` request from
@@ -330,9 +330,9 @@ If you are reading from a remote source, and there is a problem with the connect
330
330
331
331
But what about writing? E.g. you got a task that performs an expensive computation and writes updates to the remote in regular intervals. You will only detect that the remote side is gone once you write, so if you write infrequently you will perform an expensive computation despite the remote side no longer being available or interested.
332
332
333
-
To solve this, an irpc Sender has a [closed](https://docs.rs/irpc/0.5.0/irpc/channel/mpsc/enum.Sender.html#method.closed) function that you can use to detect the remote closing without having to send a message. This wraps [tokio::sync::mpsc::Sender::closed](https://docs.rs/tokio/latest/tokio/sync/mpsc/struct.Sender.html#method.closed) for local streams and [quinn::SendStream::stopped](https://docs.rs/iroh-quinn/latest/iroh_quinn/struct.SendStream.html#method.stopped) for remote streams.
333
+
To solve this, an irpc Sender has a [closed](https://docs.rs/irpc/0.5.0/irpc/channel/mpsc/enum.Sender.html#method.closed) function that you can use to detect the remote closing without having to send a message. This wraps [tokio::sync::mpsc::Sender::closed](https://docs.rs/tokio/latest/tokio/sync/mpsc/struct.Sender.html#method.closed) for local streams and [noq::SendStream::stopped](https://github.com/n0-computer/noq) for remote QUIC streams.
334
334
335
-
## Alternatives to iroh-quinn
335
+
## Alternatives to noq
336
336
337
337
If you integrate iroh protocols into an existing application, it could be that you already have a rpc system that you are happy with, like [grpc](https://grpc.io/) or [json-rpc](https://www.jsonrpc.org/).
Copy file name to clipboardExpand all lines: protocols/using-quic.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,26 @@
2
2
title: "Using QUIC"
3
3
---
4
4
5
-
## Why this matters for iroh
5
+
Every endpoint uses QUIC over UDP by default — no configuration required.
6
6
7
-
iroh is built on top of QUIC, providing connectivity, NAT traversal, and encrypted connections out of the box. While iroh handles the hard parts of networking—holepunching, relay servers, and discovery—**you still need to design how your application exchanges data once connected**.
7
+
iroh's QUIC implementation is built on
8
+
[noq](https://github.com/n0-computer/noq), which includes multipath support and
9
+
QUIC NAT traversal.
10
+
11
+
All connections are encrypted and authenticated using TLS 1.3. Holepunching,
12
+
relay fallback, and multipath are all handled at the QUIC layer automatically.
13
+
14
+
## Custom transports
15
+
16
+
QUIC over UDP is the default, but iroh supports plugging in additional custom
17
+
transports alongside it.
18
+
19
+
All transports, even custom transports [Tor](/transports/tor), [Nym](/transports/nym), and
While iroh handles the hard parts of networking—holepunching, relay servers, and discovery—**you still need to design how your application exchanges data once connected**.
8
25
9
26
Many developers reach for iroh expecting it to completely abstract away the underlying transport. However, iroh intentionally exposes QUIC's powerful stream API because:
10
27
@@ -15,7 +32,7 @@ Many developers reach for iroh expecting it to completely abstract away the unde
15
32
Think of iroh as giving you **reliable, secure tunnels between peers**. This guide shows you how to use QUIC's streaming patterns to build efficient protocols inside those tunnels. Whether you're adapting an existing protocol or designing something new, understanding these patterns will help you make the most of iroh's capabilities.
16
33
17
34
<Note>
18
-
iroh uses a fork of [Quinn](https://docs.rs/iroh-quinn/latest/iroh_quinn/), a pure-Rust implementation of QUIC maintained by [n0.computer](https://n0.computer). Quinn is production-ready, actively maintained, and used by projects beyond iroh. If you need lower-level QUIC access or want to understand the implementation details, check out the [Quinn documentation](https://docs.rs/iroh-quinn/latest/iroh_quinn/).
35
+
iroh uses [noq](https://github.com/n0-computer/noq), a pure-Rust QUIC implementation maintained by [n0.computer](https://n0.computer). noq is production-ready, actively maintained, and used by projects beyond iroh. If you need lower-level QUIC access or want to understand the implementation details, check out the [noq repository](https://github.com/n0-computer/noq).
0 commit comments