Commit 03dfe35
feat(dev/tunnel): WSS client + frame protocol (Phase 1, no integration yet)
Adds the WebSocket side of `mirrorstack dev`:
- Frame envelope (type, id, corr_id, stream_id, payload) — wire-shape
matches api-platform's internal/dispatch/ws/frames.go
- Connect: opens wss_url?token=ttok, sends register, awaits register_ack
- Background task: pings every 30s, replies to server pings, sends
close frame on shutdown signal
Deferred frame types (rpc.*, sql.*) are enumerated in the FrameType enum
so server frames of those shapes deserialize without forcing a reconnect
once those planes go live.
This module is `#[allow(dead_code)]` for now — it compiles + tests but
isn't wired into the dev lifecycle yet. End-to-end integration requires
two pieces still in flight elsewhere:
- api-platform AWS Sender impl (apigatewaymanagementapi.PostToConnection)
- IaC for the WS API GW + Lambda routing
Once those land, a small follow-up PR plugs this module into dev::run
and adds a --tunnel flag that gates the connect.
Deps added (used only inside this module):
- tokio (rt + macros + time + sync + net + io-util)
- tokio-tungstenite (connect + rustls-tls-webpki-roots)
- futures-util (sink + std)
Test plan:
- [x] cargo test (4 new round-trip + uniqueness tests)
- [x] cargo clippy --all-targets -- -D warnings clean
- [x] cargo fmt --all -- --check clean
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 20ccff7 commit 03dfe35
4 files changed
Lines changed: 438 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
0 commit comments