Skip to content

rust: implement relay client#626

Open
connor4312 wants to merge 5 commits intomicrosoft:mainfrom
connor4312:connor4312/rs-client-relay
Open

rust: implement relay client#626
connor4312 wants to merge 5 commits intomicrosoft:mainfrom
connor4312:connor4312/rs-client-relay

Conversation

@connor4312
Copy link
Copy Markdown
Member

@connor4312 connor4312 commented Apr 27, 2026

📣 Builds upon #624 -- only the last commit in this PR is new

Rust had a relay host, but never actually implemented a relay client.

  • Imnplement relay_tunnel_client.rs (of course)
  • Updated incorrect type generation of some Rust models. These were just never hit in my code paths before, previously list_tunnels/get_tunnels could never return TunnelRelayTunnelEndpoint information. Now our Rust structure matches what Go does where TunnelRelayTunnelEndpoint is a field inside the TunnelEndpoint struct, so its fields are accessible.
  • GPT 5.5 did some very impressive analysis to find the bug that led to adding CHANNEL_WRITE_CHUNK_SIZE. This was just never something I hit consistently enough before to repro and fix.

- chrono->jiff as chrono is going into maintence mode chronotope/chrono#1423 (comment)
- async-trait replaced when possible with Rust 1.75+ native async traits; kept for compat with russh
- futures->futures_util, underlying library for just the things we need
- urlencoding->percent-encoding as it's already a dep of the url module, so just one less dependency
- general version updates

Verified in the VS Code CLI that tunnel functionality still works as expected with these updates.
Rust had a relay host, but never actually implemented a relay client.

- Imnplement relay_tunnel_client.rs (of course)
- Updated incorrect type generation of some Rust models. These were just
  never hit in my code paths before, previously list_tunnels/get_tunnels
  could never return TunnelRelayTunnelEndpoint information. Now our Rust
  structure matches what Go does where TunnelRelayTunnelEndpoint is a
  field inside the TunnelEndpoint struct, so its fields are accessible.
- GPT 5.5 did some very impressive analysis to find the bug that led to
  adding `CHANNEL_WRITE_CHUNK_SIZE`. This was just never something I hit
  consistently enough before to repro and fix.
Copy link
Copy Markdown
Member

@DavidObando DavidObando left a comment

Choose a reason for hiding this comment

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

Consulting on one security-sensitive item. Will approve if things check out.

Comment thread rs/src/connections/relay_tunnel_client.rs Outdated
Comment thread rs/src/connections/relay_tunnel_client.rs
Comment thread rs/src/connections/relay_tunnel_client.rs
Comment thread rs/src/contracts/tunnel_endpoint.rs
Comment thread rs/src/connections/relay_tunnel_client.rs Outdated
Comment thread rs/src/connections/relay_tunnel_client.rs
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