CodespacesMobileNext.jsCoding Agents

HTTPS app previews from a phone for remote coding agents

November 14, 2026 · Oyren AI Team (AI-written)

TL;DR: A remote coding agent's web app needs an HTTPS preview address that reaches the server running it. Oyren Cloud Codespaces provide managed HTTPS routing beside the terminal, web editor and browser stream, so a phone can inspect the app while the agent session stays on the cloud machine.

Choose or create a workspace, then select the agents and repositories for the workflow.

Oyren Mind Map of app and API ports, HTTPS preview access on a phone, and the authenticated terminal and browser review loop

Public routes combine app and API traffic on one origin. A private port share reaches one upstream, while the authenticated control session handles the terminal and browser stream.

HTTPS preview options

Opening localhost on a phone reaches the phone itself. When Claude Code or Codex starts a Next.js server on a remote machine, its listening port belongs to that machine; a preview gateway or a tunnel connects the two. An SSH forward opened on a laptop terminates on that laptop, so the phone needs its own forwarding client or another reachable address.

RoutePhone accessSetup and boundary
RouteOyren Cloud Codespace app routePhone accessManaged public HTTPS addressSetup and boundaryPath-to-port mapping; app authentication remains the app's responsibility
RouteOyren private port sharePhone accessExpiring HTTPS link for one upstream portSetup and boundaryAnyone holding the link can use it; the link does not grant terminal access
RouteSSH forwarding on the phonePhone accessThrough the phone's forwarding clientSetup and boundaryServer, SSH access and active forwarding connection required
RouteSelf-managed server or paired spare machine (device beta)Phone accessOwn HTTPS proxy or tunnelSetup and boundaryNo managed Oyren HTTPS; device enrollment availability still applies

The phone agent guide covers session control. The remaining work here is reaching the app and testing its rendered behavior.

One origin for Next.js and a separate API

A root route suits a Next.js app that expects its assets at /_next/. In the repository terminal, a development server can listen on port 3000:

npx next dev --hostname 127.0.0.1 --port 3000

The Next.js CLI accepts an explicit hostname and port. This loopback listener works when Next.js and the Oyren gateway share a network namespace. In another terminal, with a separate API already serving /health on port 8000, the route configuration is:

oyren route add / 3000 "Web app"
oyren route add /api 8000 "App API"
oyren route list

Both paths use the Codespace's HTTPS origin. The longer /api match takes priority over /, and the gateway strips that prefix: /api/health reaches /health on port 8000. Browser code can call fetch('/api/health') without embedding a remote port or a loopback address. If Next.js owns the app's API routes, the root rule is sufficient; the second rule would divert those requests.

Path prefixes, assets and Docker boundaries

A route reaching the HTML page can still leave scripts or API requests broken. Oyren's normal prefix routes strip the matched prefix and do not rewrite HTML asset URLs.

SymptomBoundary to inspectCorrection
SymptomHTML loads under /demo, scripts failBoundary to inspectAbsolute asset paths escape the prefixCorrectionRoot routing for an app built for /
SymptomAPI request reaches the wrong handlerBoundary to inspect/api was removed upstreamCorrectionBackend path matched to the stripped URL, or an explicitly prefix-preserving proxy
SymptomDocker app answers inside its container onlyBoundary to inspectContainer loopback differs from gateway loopbackCorrectionListener on 0.0.0.0 inside the app container and a port reachable from the gateway
SymptomApp renders but hot reload failsBoundary to inspectDevelopment WebSocket or origin policyCorrectionDev-server logs and the framework's allowed-origin configuration

Next.js basePath is a build-time setting. Setting it to /demo also requires the proxy to preserve that path upstream; adding a normal stripping route alone is insufficient. Docker's port publishing documentation explains host bindings. A host-only published port remains separate from another container's loopback interface.

Public routes and private review

App routes are public. The session authentication protecting Oyren's terminal and browser controls does not protect the app behind a public route. An app with private data needs its own authentication or a suitably restricted review path.

For a single-port review, oyren share 3000 --ttl 1h creates an expiring bearer link scoped to that port. The default lifetime is 24 hours, with a maximum of seven days; oyren share --revoke-all revokes existing share links. A port share forwards to one upstream, so a separate API needs to sit behind that app's own proxy for this mode. Apps with absolute asset URLs still need compatible path handling. Full session links carry broader access and belong outside PRs, screenshots and social posts.

Visual verification on the actual phone

The Codespace browser stream shows a browser running on the server. It helps reproduce a failure beside the terminal logs; opening the HTTPS app directly in the phone's browser tests the phone's layout, touch input and on-screen keyboard.

  1. The phone opens the app's HTTPS address and a deep link, then reloads the deep link to test routing and asset loading.
  2. A form submission exercises the API. Visible success and error states, plus matching server logs, distinguish a working flow from an HTML-only preview.
  3. The same page is checked with the keyboard open and in both orientations. A screenshot and the failing path give the agent a concrete correction target.
  4. The terminal identifies the tested commit and records the relevant test result. The phone repeats the failing action after the correction; the diff still needs review before a merge.

The code review guide covers that merge decision, while the iPad and phone workflow covers reconnecting to persistent sessions. A preview works only while its server and host remain running.

Managed compute and the device beta

Oyren Cloud Codespaces are paid managed Linux servers with HTTPS preview routing, a web editor, terminal and browser stream, controlled from oyren.ai on a phone or desktop. Cloud machine time has a one-hour minimum, then is billed by the minute. Extensions are billed by the minute. Model-provider usage is separate; the plans page lists current rates.

Supported devices in Oyren's request-only device beta have no pairing fee or managed public HTTPS. Enrollment requires approval for a Mac or 64-bit Raspberry Pi using Docker and the private kit; general rented Linux-server and Windows enrollment remain planned. A separately rented server can host agents over SSH with its own proxy. Unattended agents on a primary personal laptop run shell commands near personal files and credentials, so a dedicated spare machine or isolated cloud server is a safer host.

The Codespaces page describes managed compute. The development workspace is the starting point for a cloud machine and its mobile review tools.

Choose or create a workspace, then select the agents and repositories for the workflow.

Open Codespace setup

Cloud development environment for coding agents