Skip to content

lib: add the relay tunnel transport primitives - #153

Merged
mvo5 merged 1 commit into
systemd:mainfrom
mvo5:relayd-4
Oct 21, 2026
Merged

mvo5 merged 1 commit into
systemd:mainfrom
mvo5:relayd-4

Conversation

@mvo5

@mvo5 mvo5 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

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.

@katexochen katexochen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good on the surface, but I'm not confident in judging the rust networking stuff.

@mvo5
mvo5 force-pushed the relayd-4 branch 7 times, most recently from b8a68d8 to 50f4c21 Compare October 19, 2026 17:49
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.
@mvo5

mvo5 commented Oct 21, 2026

Copy link
Copy Markdown
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.

@mvo5
mvo5 merged commit 70f2a1a into systemd:main Oct 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants