Skip to content

Commit c24c24f

Browse files
authored
Merge pull request #7 from bas3line/feat/http-share
Route local HTTP shares through the Sandbox wildcard edge
2 parents 29e260b + fd062cc commit c24c24f

26 files changed

Lines changed: 1534 additions & 27 deletions

Cargo.lock

Lines changed: 24 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ members = [
1313
]
1414

1515
[workspace.package]
16-
version = "0.1.1"
16+
version = "0.1.5"
1717
edition = "2024"
1818
rust-version = "1.97.1"
1919
authors = ["Sandbox contributors"]
@@ -37,6 +37,7 @@ http = "1.4.2"
3737
openssl-sys = { version = "0.9.117", features = ["vendored"] }
3838
pq-sys = { version = "0.7.5", features = ["bundled"] }
3939
reqwest = { version = "0.13.4", default-features = false, features = ["json", "rustls", "stream"] }
40+
rustls = { version = "0.23.42", default-features = false, features = ["aws_lc_rs", "std", "tls12"] }
4041
secrecy = { version = "0.10.3", features = ["serde"] }
4142
serde = { version = "1.0.228", features = ["derive"] }
4243
serde_json = "1.0.150"
@@ -45,6 +46,7 @@ subtle = "2.6.1"
4546
tempfile = "3.27.0"
4647
thiserror = "2.0.18"
4748
tokio = { version = "1.53.0", features = ["full"] }
49+
tokio-tungstenite = { version = "0.29.0", features = ["rustls-tls-native-roots"] }
4850
tokio-util = "0.7.18"
4951
tower-http = { version = "0.7.0", features = ["catch-panic", "cors", "limit", "request-id", "timeout", "trace"] }
5052
tracing = "0.1.44"
@@ -53,12 +55,12 @@ url = { version = "2.5.8", features = ["serde"] }
5355
uuid = { version = "1.24.0", features = ["serde", "v7"] }
5456
zeroize = { version = "1.8.2", features = ["derive"] }
5557

56-
sandbox-aegis = { version = "0.1.1", path = "crates/aegis" }
57-
sandbox-client = { version = "0.1.1", path = "crates/client" }
58-
sandbox-core = { version = "0.1.1", path = "crates/core" }
59-
sandbox-events = { version = "0.1.1", path = "crates/events" }
60-
sandbox-runtime = { version = "0.1.1", path = "crates/runtime" }
61-
sandbox-storage = { version = "0.1.1", path = "crates/storage" }
58+
sandbox-aegis = { version = "0.1.5", path = "crates/aegis" }
59+
sandbox-client = { version = "0.1.5", path = "crates/client" }
60+
sandbox-core = { version = "0.1.5", path = "crates/core" }
61+
sandbox-events = { version = "0.1.5", path = "crates/events" }
62+
sandbox-runtime = { version = "0.1.5", path = "crates/runtime" }
63+
sandbox-storage = { version = "0.1.5", path = "crates/storage" }
6264

6365
[workspace.lints.rust]
6466
unsafe_code = "forbid"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,14 @@ sandbox create --tenant platform --image ubuntu:24.04 \
6262
--network restricted --untrusted-repo --generated-code
6363

6464
sandbox exec 019f... -- cargo test --workspace
65+
sandbox http 3000
6566
sandbox tunnel create 019f... --port 3000
6667
sandbox agent run codex --tenant platform
6768
sandbox delete 019f... --wait
6869
```
6970

71+
`sandbox http PORT` shares a service running on your current machine at a temporary `https://local-….tunnel.yshubham.com` URL through the hosted Sandbox relay. No third-party quick-tunnel domain or helper binary is involved. HTTP and WebSocket traffic—including Vite HMR—is carried over one outbound WebSocket and rewritten to the loopback origin, so development servers never need to allow a random public `Host`. Keep the command running and press Ctrl-C to revoke the exact-host route. Self-hosters can set `SANDBOX_HTTP_RELAY`; services inside a managed sandbox continue to use `sandbox tunnel create SANDBOX_ID --port PORT`.
72+
7073
## What is already real
7174

7275
| Capability | Status |
@@ -80,6 +83,7 @@ sandbox delete 019f... --wait
8083
| CLI lifecycle, agent profiles, JSON output, bounded exec | Implemented |
8184
| MCP 2025-11-25 stdio server with structured tool results | Implemented |
8285
| Wildcard HTTP/WebSocket tunnels with per-sandbox edge networks | Implemented; custom HTTPS domains, direct edge, and Cloudflare ingress documented |
86+
| Local HTTP/WebSocket sharing on the deployment wildcard | Implemented; ephemeral exact-host routes, bounded sessions/bodies, automatic revocation |
8387
| Codex, Claude Code, OpenCode, Pi image builder | Implemented with pinned versions |
8488
| Aider and Goose profiles | Implemented using their official images |
8589
| OIDC/SAML, tenant RBAC, secret broker, interactive PTY, raw TCP tunnels | Design boundary; not implemented in v0.1 |

cmd/sandbox/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,21 @@ path = "src/main.rs"
1414

1515
[dependencies]
1616
anyhow.workspace = true
17+
base64.workspace = true
1718
clap.workspace = true
19+
futures-util.workspace = true
20+
http.workspace = true
21+
reqwest.workspace = true
22+
rustls.workspace = true
1823
sandbox-client.workspace = true
1924
sandbox-core.workspace = true
2025
secrecy.workspace = true
2126
serde.workspace = true
2227
serde_json.workspace = true
2328
tokio.workspace = true
29+
tokio-tungstenite.workspace = true
2430
url.workspace = true
31+
uuid.workspace = true
2532

2633
[lints]
2734
workspace = true

0 commit comments

Comments
 (0)