Route local HTTP shares through the Sandbox wildcard edge - #7
Conversation
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes — adds sandbox http PORT as a guarded shortcut over sandbox tunnel create, with automatic sandbox selection, capability gating, and active-tunnel reuse.
- New
HttpArgsstruct andrun_httpfunction — resolves the target sandbox fromSANDBOX_ID/--sandbox, or the tenant's only running sandbox; gates on/healthztunnel capabilities; reuses an existing active tunnel for the same port; falls through torun_tunnelfor new tunnels. - New helpers —
validate_http_capabilities,select_only_running_sandbox,select_only_sandbox_id, andparse_portwith unit test coverage. - Version bump
0.1.1→0.1.2acrossCargo.toml,Cargo.lock, and deployment docs. - Documentation updated in
README.md,docs/cli.md, and the agent skill reference.
DeepSeek Pro | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — rewrites run_http from a controller-mediated shortcut into a direct local sharing path that launches a subprocess tunnel (cloudflared or SSH) and scans its output for the public URL.
- Direct local sharing in
run_http— checks the port is listening on local IPv4/IPv6, resolves a tunnel provider (cloudflaredauto-preferred, fallback tossh), spawns the helper subprocess, scans stdout/stderr for the HTTPS URL with host-based validation, prints it, and blocks on Ctrl-C. - New
HttpProviderenum and supporting infrastructure —resolve_http_provider,find_executable,find_ssh,provider_command,public_url_in_line,provider_name,alternative_providerwith unit test coverage for CLI parsing, URL extraction, and listener detection. - Removed controller-mediated path —
validate_http_capabilities,select_only_running_sandbox,select_only_sandbox_id, and theSandboxClientparameter fromrun_httpare all gone; managed tunnels remain accessible viasandbox tunnel create. - Version 0.1.1 → 0.1.3 around the unreleased 0.1.2 — workspace version, lockfile, and deployment docs.
- Documentation updated in
README.md,docs/cli.md, and the agent skill reference to describe the new local-sharing semantics.
DeepSeek Pro | 𝕏
There was a problem hiding this comment.
Reviewed changes — replaces the standalone cloudflared/SSH local tunnel with a custom WebSocket relay through the Sandbox controller edge.
- New
local_httpclient module — connects to the relay via WebSocket, receives proxied HTTP/WebSocket requests as JSON messages, forwards to127.0.0.1:PORT, and sends responses back through the same channel. - New
local_relayserver module — accepts WebSocket connections at/v1/local-tunnels/connect, manages an in-memory session registry, writes dynamic edge routes viaNamedTempFile+persist, and proxies inbound HTTP/WebSocket traffic. - New protocol types in
sandbox_core::api—LocalRelayServerMessage,LocalRelayClientMessage, andRelayWebSocketFramewith serde-tagged serialization. - New
TunnelConfigfields —local_relay_enabled,local_relay_require_auth,local_relay_upstream,max_local_relays,max_local_relays_per_client,local_relay_body_limit_bytes,local_relay_ttl_secondswith bounded validation. - CLI args restructured —
--providerreplaced by--relay(Url, defaulthttps://relay.tunnel.yshubham.com) and--subdomain;SANDBOX_HTTP_RELAYenv var replacesSANDBOX_HTTP_PROVIDER. - Version bumped
0.1.1→0.1.4across workspace, lockfile, and deployment docs. - Edge and deployment config — Caddy files gain
relay.<domain>routes; Compose addstunnel-routes-initinit service and shared volume; authorization endpoint recognizes relay hostnames. - Documentation updated in
cli.md,configuration.md,security.md,tunnels.md,client.md, and the agent skill descriptor.
ℹ️ No critical issues — one stale doc reference inline.
Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:
skills/sandbox-platform/references/cli.md:2035(RIGHT) — line 2035 (RIGHT) is not inside a diff hunk
DeepSeek Pro | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — adds explicit rustls crypto provider initialization to guard against feature inference in release builds.
- Added
rustlsworkspace dependency withaws_lc_rs,std, andtls12features, wired intocmd/sandbox/Cargo.toml. - Installed
aws_lc_rsas the process-wide default provider at the top ofmain()so reqwest and the WebSocket relay share one TLS backend regardless of feature resolution order.
DeepSeek Pro | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues — one stale architecture reference inline.
Reviewed changes — documents the relay routing architecture across deploy configs, API and CLI docs, configuration reference, security model, tunnel guide, client setup guide, and agent skill descriptor.
- Deploy configuration — added
relay.<domain>routes to all three Caddyfile examples and the Cloudflare compose overlay. - API and CLI documentation — documented the
/v1/local-tunnels/connectWebSocket endpoint with authentication and architecture notes; restructured CLI docs into local sharing vs. managed sandbox tunnels. - Configuration, security, and tunnel docs — added all eight local relay configuration keys with descriptions and operational guidance; documented relay security model and workstation sharing workflow; updated client setup guide.
- Agent skill updates — rewrote the skill description and rule 7 to cover both
sandbox http PORTandsandbox tunnel createpaths.
DeepSeek Pro | 𝕏
| sandbox http 3000 | ||
| ``` | ||
|
|
||
| The command checks both local IPv4 and IPv6, prints a temporary public HTTPS URL, and stays attached until Ctrl-C. It does not require `SANDBOX_URL`. It prefers an installed `cloudflared` and falls back to the system SSH client with localhost.run. Treat the URL as public and never expose credentials, private data, or admin interfaces. |
There was a problem hiding this comment.
This describes the pre-relay cloudflared/SSH provider architecture from commit e929646. Since 5ee3beb the CLI connects directly to the Sandbox relay over a WebSocket — there is no cloudflared or SSH involved. The other docs (docs/cli.md, docs/tunnels.md, docs/how-to-setup/client.md, and the SKILL.md frontmatter) all correctly describe the relay. Update this paragraph to match: the CLI opens an outbound WebSocket to the relay, the controller creates a temporary route, and requests are proxied back over that channel.
Technical details
# Skill reference still describes cloudflared/SSH instead of WebSocket relay
## Affected sites
- `skills/sandbox-platform/references/cli.md:68` — says "prefers an installed cloudflared and falls back to the system SSH client with localhost.run"
## Required outcome
- Replace the cloudflared/SSH description with the WebSocket relay behavior: the CLI opens an outbound WebSocket to the relay, the controller creates a temporary exact-host route, and requests are proxied back over that channelThere was a problem hiding this comment.
ℹ️ No new issues. The prior stale-doc finding at
skills/sandbox-platform/references/cli.mdremains open and unchanged by this commit.
Reviewed changes — ensure_local_listener now returns the detected SocketAddr instead of void, probes ::1 in addition to 127.0.0.1, and threads the exact address through relay_http_request, relay_local_websocket, and local_url.
- IPv6 loopback detection and forwarding —
ensure_local_listenerprobes both127.0.0.1and::1with a 500ms timeout, returning the first address that accepts a connection. IPv4 is tried first so dual-stack listeners always get127.0.0.1.local_urlnow validates the URL host matches the expected IP version, andSocketAddrDisplay handles bracket-wrapping for IPv6 in the URL string. - Version bump 0.1.4 → 0.1.5 across workspace, lockfile,
README.md, andcustom-public-domains.md. - Documentation updated in
docs/tunnels.mdandskills/sandbox-platform/SKILL.mdto mention IPv4/IPv6 loopback detection.
DeepSeek Pro | 𝕏

What changed
relay.tunnel.yshubham.com*.tunnel.yshubham.com127.0.0.1) or IPv6 (::1) loopback listener and forwards to that exact addressserver.allowedHostschangesRoot causes
The initial shortcut launched localhost.run or Cloudflare Quick Tunnels directly from the CLI. That bypassed the Sandbox edge and produced unrelated public domains such as
*.lhr.life, which Vite correctly rejected as an untrusted Host.The first hosted-relay release detected both IPv4 and IPv6 listeners but forwarded every local request to
127.0.0.1. Frameworks such as Astro can bind only to::1, which made the public edge return 502 even though the listener preflight succeeded.User impact
sandbox http 4321now returnshttps://local-<random>.tunnel.yshubham.comand works with services bound to either loopback family. Ctrl-C removes the route immediately. Self-hosted deployments can useSANDBOX_HTTP_RELAYor--relay.Validation
cargo test --locked --workspace --all-targetscargo clippy --locked --workspace --all-targets -- -D warningsrustandsupply-chaincheckswss://: received{"type":"connected"}