Skip to content

feat(proxy): route public box service traffic#995

Merged
DorianZheng merged 11 commits into
boxlite-ai:mainfrom
G4614:codex/shared-forwarded-proxy
Jul 23, 2026
Merged

feat(proxy): route public box service traffic#995
DorianZheng merged 11 commits into
boxlite-ai:mainfrom
G4614:codex/shared-forwarded-proxy

Conversation

@G4614

@G4614 G4614 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Route public box service traffic through the API, proxy, runner, and guest-port tunnel path.

Test plan:

  • Browser preview and terminal smoke tests passed on the combined implementation before the split
  • Apps-only CI pending

Summary by CodeRabbit

  • New Features
    • Added authenticated box network proxy endpoints, including guest-port HTTP CONNECT tunneling.
    • Preview URLs now support any valid port (1–65535) with DNS-safe identifiers.
  • Bug Fixes
    • Boxes now default to public when the visibility flag is omitted.
    • Proxy preview/forwarding now consistently uses trusted, correctly formatted forwarded headers.
  • Infrastructure / Deployment
    • Updated proxy template and TLS/load-balancer handling to align with the new preview URL format.
  • Tests
    • Expanded unit and integration coverage for preview URLs, routing, CONNECT/tunneling, and forwarded-header behavior.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

Network tunnel and preview routing

Layer / File(s) Summary
API preview contracts and tunnel endpoint
apps/api-client-go/api/openapi.yaml, apps/api/src/box/dto/*, apps/api/src/box/services/*, apps/api/src/boxlite-rest/*, apps/infra/sst.config.ts
Preview URLs use encoded box IDs for non-terminal ports, boxes default to public, and the API exposes a validated network tunnel URI endpoint with TLS passthrough proxy configuration.
Runner guest-port proxy and transport
apps/runner/pkg/api/*, apps/runner/pkg/boxlite/*
Runner routes support escaped guest-port proxying and CONNECT tunnels with guest dialing, pooled transports, bidirectional relaying, and integration coverage.
Shared stream and forwarded-header utilities
apps/common-go/pkg/proxy/*
Shared proxy utilities preserve buffered bytes, relay streams in both directions, and apply trusted forwarded-header metadata.
Edge proxy target resolution and CONNECT bridging
apps/proxy/pkg/proxy/*
The edge proxy decodes direct-preview hosts, preserves escaped paths, establishes authenticated runner tunnels, tracks active CONNECT requests, and bridges client and guest streams.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant API
  participant EdgeProxy
  participant Runner
  participant Guest
  Client->>API: Request network tunnel URI
  API-->>Client: Encoded preview URI
  Client->>EdgeProxy: CONNECT preview host:port
  EdgeProxy->>Runner: Authenticated CONNECT tunnel
  Runner->>Guest: Open guest port stream
  Guest-->>Runner: Connected stream
  Runner-->>EdgeProxy: Tunnel established
  EdgeProxy-->>Client: 200 Connection Established
  Client<<->>Guest: Bidirectional traffic
Loading

Possibly related PRs

Suggested reviewers: law-chain-hot

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description omits the required Summary, Changes, and How to verify sections from the template. Add the template sections with a brief summary, key changes, verification steps, and risks/rollout if applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 6.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: routing public box service traffic through the proxy stack.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@G4614
G4614 force-pushed the codex/shared-forwarded-proxy branch from bb55fdc to 0454697 Compare July 21, 2026 13:51
@cla-assistant

cla-assistant Bot commented Jul 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cla-assistant

cla-assistant Bot commented Jul 21, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ xhebox
✅ G4614
❌ dependabot[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@G4614 G4614 changed the title feat(proxy): preserve trusted forwarded request metadata feat(proxy): route public box service traffic Jul 21, 2026
@G4614
G4614 changed the base branch from stack/c-go-box-tunnel to main July 21, 2026 19:24
@G4614
G4614 marked this pull request as ready for review July 22, 2026 03:46
@G4614
G4614 requested a review from a team as a code owner July 22, 2026 03:46
@boxlite-agent

boxlite-agent Bot commented Jul 22, 2026

Copy link
Copy Markdown

📦 BoxLite review — couldn't complete

claude exited 1

stdout:
{"type":"result","subtype":"success","is_error":true,"api_error_status":403,"duration_ms":484,"duration_api_ms":0,"num_turns":1,"result":"Your organization has disabled Claude subscription access for Claude Code · Use an Anthropic API key instead, or ask your admin to enable access","stop_reason":"stop_sequence","session_id":"3a77c3d8-28a0-44d5-bb86-6315cdc5329d","total_cost_usd":0,"usage":{"input_tokens":0,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":0,"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"inference_geo":"","iterations":[],"speed":"standard"},"modelUsage":{},"permission_denials":[],"terminal_reason":"api_error","fast_mode_state":"off","uuid":"35886c6c-8dbe-4449-992c-f6cf0425f831"}

stderr:
<empty>

powered by BoxLite

@G4614
G4614 enabled auto-merge July 22, 2026 03:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/api/src/box/services/box.service.ts (1)

223-283: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Box preview visibility now defaults to public. Both sites reflect the same root-cause change: box.public defaults to true instead of false when the caller omits it, so every new/warm-pool-assigned box becomes previewable by default rather than opt-in.

  • apps/api/src/box/services/box.service.ts#L223-L283: confirm this default flip (in both create and assignWarmPoolBox) is intentional for this PR and not an inadvertent side-effect of wiring up public box-service routing; if intentional, call it out in release/migration notes since it changes exposure for callers that don't explicitly set public.
  • apps/api/src/box/dto/create-box.dto.ts#L58-L65: this is just the Swagger-doc mirror of the service-layer default; no separate code change needed once the service-layer default is confirmed intentional.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/api/src/box/services/box.service.ts` around lines 223 - 283, Confirm the
box.public default flip to true in both create and assignWarmPoolBox is
intentional rather than an accidental routing side effect; if intentional,
document the changed default exposure in release or migration notes. The Swagger
default in apps/api/src/box/dto/create-box.dto.ts lines 58-65 requires no
separate code change once the service-layer behavior is confirmed.
🧹 Nitpick comments (2)
apps/runner/pkg/api/controllers/proxy.go (1)

188-191: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Terminal port 22222 is a magic number duplicated across services.

isTerminalToolboxPath hardcodes /proxy/22222, matching TERMINAL_PREVIEW_PORT = 22222 in apps/api/src/box/services/box.service.ts, but there's no shared constant between the Go runner and the TypeScript API. A future change to one without the other would silently break terminal routing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/runner/pkg/api/controllers/proxy.go` around lines 188 - 191, Remove the
hardcoded 22222 value from isTerminalToolboxPath and replace it with a shared
terminal preview port configuration or constant used by both the Go runner and
TypeScript API. Ensure the generated terminal paths and the
TERMINAL_PREVIEW_PORT value remain synchronized when matching the root and
nested /proxy paths.
apps/proxy/pkg/proxy/proxy.go (1)

195-198: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Consider adding ReadHeaderTimeout to mitigate slow-header DoS.

Static analysis flags the missing server timeouts (Slowloris risk, CWE-400). Since this server now also carries long-lived CONNECT tunnels, avoid a blanket ReadTimeout/WriteTimeout (which would bound the entire tunnel duration) — but ReadHeaderTimeout only bounds header-reading and is safe to add without affecting active tunnels.

🛡️ Proposed fix
 httpServer := &http.Server{
-		Addr:    fmt.Sprintf(":%d", config.ProxyPort),
+		Addr:              fmt.Sprintf(":%d", config.ProxyPort),
+		ReadHeaderTimeout: 10 * time.Second,
 		Handler: connectAwareHandler(http.HandlerFunc(proxy.handleTunnelConnect), router, shutdownWg),
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/proxy/pkg/proxy/proxy.go` around lines 195 - 198, Update the http.Server
initialization in the proxy handler to set ReadHeaderTimeout, limiting
header-reading time while leaving long-lived CONNECT tunnel activity unaffected.
Keep the existing Addr and Handler configuration unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/api/src/box/services/box.service.ts`:
- Line 223: Update the box creation logic around the public assignment in the
box service to preserve the existing default of false when createBoxDto.public
is omitted. Keep explicit public: true and public: false values unchanged, and
apply the same correction to the corresponding second assignment.

In `@apps/proxy/pkg/proxy/tunnel.go`:
- Around line 24-65: Update handleTunnelConnect to call the existing
getBoxPublic/Authenticate authorization path after resolving boxID and before
getBoxRunnerInfo or dialRunnerTunnel. Reject boxes that are not public with HTTP
403, ensuring private-box CONNECT requests never dial the runner.

In `@apps/runner/pkg/api/controllers/proxy.go`:
- Around line 230-251: Update handleGuestPortProxy and the surrounding proxy
lifecycle to reuse a *http.Transport per (boxId, port) instead of creating one
for every request. Add bounded, lifecycle-aware caching with idle/TTL eviction,
ensure concurrent requests safely share transports, and close/remove transports
when they expire or the box is deleted; retain the existing ReverseProxy
behavior and error handling.
- Around line 252-265: Update guestPortProxyErrorMessage to avoid returning raw
err.Error() text for unrecognized failures; preserve the existing friendly
message for known connection errors, but return a generic client-facing guest
port proxy failure message while keeping detailed diagnostics exclusively in the
existing logger.WarnContext path.

---

Outside diff comments:
In `@apps/api/src/box/services/box.service.ts`:
- Around line 223-283: Confirm the box.public default flip to true in both
create and assignWarmPoolBox is intentional rather than an accidental routing
side effect; if intentional, document the changed default exposure in release or
migration notes. The Swagger default in apps/api/src/box/dto/create-box.dto.ts
lines 58-65 requires no separate code change once the service-layer behavior is
confirmed.

---

Nitpick comments:
In `@apps/proxy/pkg/proxy/proxy.go`:
- Around line 195-198: Update the http.Server initialization in the proxy
handler to set ReadHeaderTimeout, limiting header-reading time while leaving
long-lived CONNECT tunnel activity unaffected. Keep the existing Addr and
Handler configuration unchanged.

In `@apps/runner/pkg/api/controllers/proxy.go`:
- Around line 188-191: Remove the hardcoded 22222 value from
isTerminalToolboxPath and replace it with a shared terminal preview port
configuration or constant used by both the Go runner and TypeScript API. Ensure
the generated terminal paths and the TERMINAL_PREVIEW_PORT value remain
synchronized when matching the root and nested /proxy paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0431ead1-f290-45dc-a6ef-15c4e1e2ad2f

📥 Commits

Reviewing files that changed from the base of the PR and between 8aa46fb and a8ccd13.

📒 Files selected for processing (21)
  • apps/api-client-go/api/openapi.yaml
  • apps/api/src/box/dto/create-box.dto.ts
  • apps/api/src/box/dto/port-preview-url.dto.ts
  • apps/api/src/box/services/box.service.spec.ts
  • apps/api/src/box/services/box.service.ts
  • apps/api/src/boxlite-rest/boxlite-proxy.controller.spec.ts
  • apps/api/src/boxlite-rest/boxlite-proxy.controller.ts
  • apps/api/src/boxlite-rest/boxlite-rest-routing.spec.ts
  • apps/common-go/pkg/proxy/proxy.go
  • apps/common-go/pkg/proxy/proxy_test.go
  • apps/infra/sst.config.ts
  • apps/proxy/pkg/proxy/get_box_target.go
  • apps/proxy/pkg/proxy/get_box_target_test.go
  • apps/proxy/pkg/proxy/proxy.go
  • apps/proxy/pkg/proxy/tunnel.go
  • apps/proxy/pkg/proxy/tunnel_test.go
  • apps/runner/pkg/api/controllers/proxy.go
  • apps/runner/pkg/api/controllers/proxy_integration_test.go
  • apps/runner/pkg/api/controllers/proxy_test.go
  • apps/runner/pkg/api/server.go
  • apps/runner/pkg/boxlite/guest_port_tunnel.go

Comment thread apps/api/src/box/services/box.service.ts
Comment thread apps/proxy/pkg/proxy/tunnel.go
Comment thread apps/runner/pkg/api/controllers/proxy.go Outdated
Comment thread apps/runner/pkg/api/controllers/proxy.go Outdated
@G4614
G4614 force-pushed the codex/shared-forwarded-proxy branch from bceb2b7 to a14e11a Compare July 22, 2026 08:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
apps/api/src/boxlite-rest/boxlite-proxy.controller.spec.ts (1)

56-64: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider covering the port-validation and non-public-box branches too.

The new test only exercises the happy path. Given proxyNetworkTunnel also returns 400 for out-of-range ports (per the controller contract), a quick additional case would guard that branch from regressing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/api/src/boxlite-rest/boxlite-proxy.controller.spec.ts` around lines 56 -
64, Add tests alongside the existing proxyNetworkTunnel happy-path case to cover
out-of-range port validation and the non-public-box branch, asserting each
returns the controller’s expected 400 response and does not invoke the preview
URL service. Use the existing makeHarness setup and response mock.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/proxy/pkg/proxy/proxy.go`:
- Line 178: Configure a ReadHeaderTimeout on the HTTP server that serves the
CONNECT proxy, using an appropriate bounded duration so slow clients cannot
delay proxy.handleTunnelConnect indefinitely. Do not add a normal WriteTimeout,
since the tunnel handled by connectAwareHandler is intentionally long-lived.

In `@apps/runner/pkg/api/controllers/proxy.go`:
- Around line 141-154: Update the hijacked client connection flow before
ProxyBidirectionalStream to preserve bytes already buffered by buffered.Reader.
Wrap clientConn with a reader/connection that drains buffered.Reader before
reading from the underlying socket, then pass that wrapper to
ProxyBidirectionalStream while retaining the existing response write, flush, and
cleanup behavior.
- Around line 128-132: Update the error response in the DialGuestPort failure
path to return a generic 502 message instead of err.Error(). Preserve the
existing detailed logger.WarnContext call and its error context, while keeping
the current status code and early return behavior unchanged.

---

Nitpick comments:
In `@apps/api/src/boxlite-rest/boxlite-proxy.controller.spec.ts`:
- Around line 56-64: Add tests alongside the existing proxyNetworkTunnel
happy-path case to cover out-of-range port validation and the non-public-box
branch, asserting each returns the controller’s expected 400 response and does
not invoke the preview URL service. Use the existing makeHarness setup and
response mock.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0d23c080-98d1-4804-8dc8-77d56ad6a23b

📥 Commits

Reviewing files that changed from the base of the PR and between bceb2b7 and a14e11a.

📒 Files selected for processing (23)
  • apps/api-client-go/api/openapi.yaml
  • apps/api/src/box/dto/create-box.dto.ts
  • apps/api/src/box/dto/port-preview-url.dto.ts
  • apps/api/src/box/services/box.service.spec.ts
  • apps/api/src/box/services/box.service.ts
  • apps/api/src/boxlite-rest/boxlite-proxy.controller.spec.ts
  • apps/api/src/boxlite-rest/boxlite-proxy.controller.ts
  • apps/api/src/boxlite-rest/boxlite-rest-routing.spec.ts
  • apps/common-go/pkg/proxy/proxy.go
  • apps/common-go/pkg/proxy/proxy_test.go
  • apps/infra/sst.config.ts
  • apps/proxy/pkg/proxy/get_box_target.go
  • apps/proxy/pkg/proxy/get_box_target_test.go
  • apps/proxy/pkg/proxy/proxy.go
  • apps/proxy/pkg/proxy/tunnel.go
  • apps/proxy/pkg/proxy/tunnel_test.go
  • apps/runner/pkg/api/controllers/proxy.go
  • apps/runner/pkg/api/controllers/proxy_integration_test.go
  • apps/runner/pkg/api/controllers/proxy_test.go
  • apps/runner/pkg/api/server.go
  • apps/runner/pkg/boxlite/client.go
  • apps/runner/pkg/boxlite/guest_port_tunnel.go
  • apps/runner/pkg/boxlite/guest_port_tunnel_test.go
🚧 Files skipped from review as they are similar to previous changes (18)
  • apps/api/src/box/dto/port-preview-url.dto.ts
  • apps/api-client-go/api/openapi.yaml
  • apps/api/src/box/services/box.service.ts
  • apps/api/src/box/dto/create-box.dto.ts
  • apps/runner/pkg/api/server.go
  • apps/api/src/boxlite-rest/boxlite-proxy.controller.ts
  • apps/runner/pkg/boxlite/guest_port_tunnel_test.go
  • apps/common-go/pkg/proxy/proxy_test.go
  • apps/proxy/pkg/proxy/tunnel_test.go
  • apps/common-go/pkg/proxy/proxy.go
  • apps/proxy/pkg/proxy/get_box_target_test.go
  • apps/runner/pkg/boxlite/client.go
  • apps/runner/pkg/api/controllers/proxy_integration_test.go
  • apps/infra/sst.config.ts
  • apps/api/src/box/services/box.service.spec.ts
  • apps/runner/pkg/boxlite/guest_port_tunnel.go
  • apps/runner/pkg/api/controllers/proxy_test.go
  • apps/proxy/pkg/proxy/get_box_target.go

Comment thread apps/proxy/pkg/proxy/proxy.go Outdated
Comment thread apps/runner/pkg/api/controllers/proxy.go Outdated
Comment thread apps/runner/pkg/api/controllers/proxy.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/proxy/pkg/proxy/proxy.go (1)

236-246: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Close active CONNECT tunnels before waiting on shutdown. A live CONNECT tunnel stays tracked in shutdownWg after hijack, so shutdown can sit until the timeout because http.Server.Shutdown won’t close it. Add a tunnel-close signal before shutdownWg.Wait() and cover the active-tunnel shutdown path in tests.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/proxy/pkg/proxy/proxy.go` around lines 236 - 246, Update
connectAwareHandler to register each hijacked CONNECT tunnel with the existing
shutdown mechanism and ensure shutdown signals active tunnels to close before
shutdownWg.Wait() runs. Preserve normal CONNECT handling and completion
bookkeeping, and add coverage for an active tunnel being closed during shutdown.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@apps/proxy/pkg/proxy/proxy.go`:
- Around line 236-246: Update connectAwareHandler to register each hijacked
CONNECT tunnel with the existing shutdown mechanism and ensure shutdown signals
active tunnels to close before shutdownWg.Wait() runs. Preserve normal CONNECT
handling and completion bookkeeping, and add coverage for an active tunnel being
closed during shutdown.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 54d6732f-0515-4a94-badb-78b9bd5754b4

📥 Commits

Reviewing files that changed from the base of the PR and between a14e11a and ae1b144.

📒 Files selected for processing (6)
  • apps/common-go/pkg/proxy/proxy.go
  • apps/common-go/pkg/proxy/proxy_test.go
  • apps/proxy/pkg/proxy/proxy.go
  • apps/proxy/pkg/proxy/tunnel.go
  • apps/proxy/pkg/proxy/tunnel_test.go
  • apps/runner/pkg/api/controllers/proxy.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • apps/common-go/pkg/proxy/proxy_test.go
  • apps/proxy/pkg/proxy/tunnel.go
  • apps/common-go/pkg/proxy/proxy.go
  • apps/proxy/pkg/proxy/tunnel_test.go
  • apps/runner/pkg/api/controllers/proxy.go

@G4614
G4614 force-pushed the codex/shared-forwarded-proxy branch from ae1b144 to a618d5a Compare July 22, 2026 11:12
@G4614
G4614 force-pushed the codex/shared-forwarded-proxy branch from d53b877 to 9af9041 Compare July 22, 2026 12:33
@DorianZheng
DorianZheng disabled auto-merge July 23, 2026 03:21
@DorianZheng
DorianZheng merged commit b1ba38a into boxlite-ai:main Jul 23, 2026
29 checks passed
DorianZheng pushed a commit that referenced this pull request Jul 23, 2026
Route browser HTTP previews through the edge proxy over the runner
CONNECT tunnel merged in PR #995.

Test plan:
- [x] `cd apps/common-go && go test -race ./pkg/proxy`
- [x] `cd apps/proxy && go test -race ./pkg/proxy`
- [x] `cd apps/api && yarn jest --passWithNoTests=true --runInBand
src/box/services/box.service.spec.ts --testNamePattern='^BoxService
preview URLs'`
- [x] `cd apps/api && yarn prettier --check
src/box/dto/port-preview-url.dto.ts src/box/services/box.service.ts
src/box/services/box.service.spec.ts`
- [ ] Pre-push full matrix: local libkrunfw/e2fsprogs native build
environment failed.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Preview URLs now use DNS-safe encoded box identifiers for service
ports and network tunnels.
* Proxy routing improves guest-port handling and supports robust
bidirectional stream proxying.
* Box activity refresh is more consistently applied during active proxy
sessions.
* **Bug Fixes**
* Non-terminal port preview URLs are now generated instead of being
rejected.
* Forwarded header handling is tightened so untrusted client values are
not propagated.
* Box creation defaults to public when omitted (and respects an explicit
`false`); legacy preview formats remain supported.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@G4614
G4614 deleted the codex/shared-forwarded-proxy branch July 23, 2026 08:16
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