Code Remote

Ports & preview

Open the dev servers on your computer from your iPhone, share one for a while, and see the requests that reach it.

All of this needs coderemote 0.2.0 or later on the computer. With an older one the app says so: run coderemote update (or npm install -g coderemote@latest) and start coderemote up again.

The Ports tab

Lists the TCP ports your user is listening on, refreshed every few seconds:

  • Started in Code Remote: servers you started from a terminal in the app, with a shortcut back to that terminal.
  • Other: everything else running in a project folder, such as a server you started on the computer itself.
  • Background: apps and system services, hidden until you ask for them.

Swipe a port to stop the process behind it (it gets SIGTERM, like Ctrl+C); hold it for Force Stop (SIGKILL). Only a process that is listening right now can be stopped, and never another user's. Stopping another coderemote agent asks first, since every device paired with it loses its folder.

Preview

Tap a port to open it in the app. The first time takes a few seconds while the computer opens it on the tunnel; after that it loads like any page, already signed in as you.

  • Servers on localhost, 127.0.0.1 or ::1 all work: there's no need to make your dev server listen on every interface.
  • Requests reach your server addressed to localhost:<port>, so servers that check the host name (Vite, for one) accept them as they are.
  • Copy Link and Open in Safari give you the preview's address. It's private: Safari asks you to sign in with the same account first.
  • Stop Preview takes the port off the tunnel. Your server keeps running.
  • When your server stops (you stop it in the Ports tab, close its terminal, press Ctrl+C, or it crashes), its preview ends by itself once nothing has listened on the port for 30 seconds, public link included. A server that restarts within that time keeps its preview. One you stop from the Ports tab loses it right away. Needs coderemote 0.3.8 or later.

Previewed ports are marked in the Ports tab.

Share a public link

To show your work to someone without an account, open the preview's menu and choose Share Publicly, for one hour, eight hours or a day. Until then, anyone with the link can open that port without signing in.

  • Only that port is shared. The agent, its files and its terminal stay private, on a tunnel of their own.
  • A banner shows until when the link is public, with Make Private to end it now. The Ports tab marks the port with a globe.
  • The link also stops working when you stop the preview or the agent.

Remember that it's a development server: share it with people you'd show your screen to, and make it private when you're done.

Requests

The list icon in a preview shows the requests that reached that port, newest first and live: method, path, status, time and size, colored by status. Tap one for its headers and bodies; JSON is indented and compressed bodies are unpacked.

  • It works for anything that comes through the preview link: the page itself, its API calls, a webhook you pointed at a shared link.
  • The latest 200 requests per port are kept, with bodies up to 64 KB. WebSockets (hot reload) pass through untouched; only their handshake is listed.
  • They stay on your computer, in memory: Clear forgets them, and so does stopping coderemote up.

The bar under the list narrows it down. The filter button picks a kind (All, Fetch/XHR, CSS, Image or JS, judged from the response type and the file extension), and the search field matches the method and path.

The same log can be read in a terminal on the computer with coderemote requests, so a coding agent like Claude Code can debug with it. Tokens and cookies are masked there unless it asks for them.

How it works

Previews don't go through the agent's own tunnel. The first time you preview a port, the agent creates a second private tunnel, labelled coderemote-preview, and forwards your ports there. Adding or removing a port restarts that tunnel's connection, so other open previews blink for a moment, while your terminals, files and git never notice.

Each previewed port goes through a small proxy in the agent, which is what records the requests. That's why a preview's address carries the proxy's port number rather than your server's (…-49213.usw2.devtunnels.ms for a server on 5173): the app always shows your server's own port.

The agent deletes the preview tunnel when it stops; if it can't (the computer went offline, say), the next coderemote up does. Shared links never outlive the agent that made them, and old previews don't use up your account's 10 tunnels. When the account is full anyway, a new preview first deletes preview tunnels no agent serves; if that isn't enough, the app says so, and coderemote tunnels on the computer shows what to delete.