Repository navigation
lib: add the relay tunnel transport primitives - #153
Merged
Merged
Conversation
katexochen
reviewed
Oct 15, 2026
katexochen
left a comment
Member
There was a problem hiding this comment.
looks good on the surface, but I'm not confident in judging the rust networking stuff.
mvo5
force-pushed
the
relayd-4
branch
7 times, most recently
from
October 19, 2026 17:49
b8a68d8 to
50f4c21
Compare
We want to build a http2 (h2) tunnel over a WebSocket so that we
can tunnel varlink back into a node. The idea is that the
node opens a WebSocket to relayd and a caller can then get
to the node via the node-id via the http2 tunnel.
By using http2 we also get multi-plexing, flow-control and
backpressure for free. We configure the h2 stream for max 64
concurrent streams with 256kb window size. This should give
us reasonable throughput and also caps the memory use per node.
This commit holds the TunnelStream that is used by both client and
server. The new {client,server}_handshake() API sets up http2 over
the WebSocket with preconfigured window sizes for node and relay.
Contributor
Author
|
Given that this is just new transport code that is not used yet the risk seems small. I will merge and anything build on top will be marked experimental for now. But I would really like to keep experimenting with this and see how nice (or not) a h2 based tunnel/relay will be code-wise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We want to build a http2 (h2) tunnel over a WebSocket so that we can tunnel varlink back into a node. The idea is that the node opens a WebSocket to relayd and a caller can then get to the node via the node-id via the http2 tunnel.
By using http2 we also get multi-plexing, flow-control and backpressure for free. We configure the h2 stream for max 64 concurrent streams with 256kb window size. This should give us reasonable throughput and also caps the memory use per node.
This commit holds the TunnelStream that is used by both client and server. The new {node,relay}_handshake() API sets up http2 over the WebSocket with preconfigured window sizes for node and relay.