Skip to content

Self-hosting and security

Open A Server From Another Computer

Open a dev server that runs on another paired computer from the computer in front of you, without an SSH tunnel or an exposed port.

  • 7 min read
  • 6 sections

Open A Server From Another Computer ​

When an agent or you start a dev server in a Code thread on one paired computer (the host), you can open the page on the computer in front of you (the client). Octant carries the page's requests to the host over the host's private HTTPS listener, so nothing needs an SSH tunnel and no new port is exposed.

What it needs ​

  • The Octant desktop app on the client. A paired browser and the phone cannot attach a device proof to a page's own requests, so there Open keeps the host's picture and says to use the Octant app.
  • A paired device. The client is paired with the host under Remote Access and still has access.
  • A server Octant started, in a thread. The server must be listening, run in a Code thread's own worktree, and belong to a thread this device can already read. A server Octant did not start, or one in the Project folder itself, opens only on the host. Its row says so.

Open a server ​

In the Octant desktop app, choose the other computer in the Environments filter so the start screen shows only that computer. Its Running services card then lists the servers running there, and a server that qualifies has Open and Open in browser.

  • Open shows the page in a window of Octant's own browser that only you control; links to other sites open in your default browser.
  • Open in browser shows it in your default browser.

The page gets its own name on your computer, <port>-<label>.octant.localhost, so its cookies and storage stay apart from your own localhost servers and from Octant. The same server keeps the same name across reopens and restarts, as long as Octant gets the same local port it used before.

Octant's browser keeps what a page stores, so a sign-in inside your dev app survives a reopen. Removing the other computer from Octant, or unpairing this device from it, closes that computer's open pages and deletes everything they stored: cookies, local storage, and caches. Your default browser keeps its own storage for Open in browser pages; clear it in that browser. If Octant could not delete everything, it keeps the page names so the next removal tries again.

Open a server from its thread ​

Unmerged preview work

This section describes behavior in open pull request #2754, which is not yet in a release. It builds on Work on another computer.

When you follow a thread on another computer from this window, the thread lists its own servers that this device may open, under Servers on <computer>. Each row has Open in Octant and Open in default browser, which work as Open and Open in browser do above. The other computer checks the server again against that thread, and the thread's access there decides. The page never opens as one of this window's Browser tabs, which belong to threads on this computer.

Forward a port ​

Unmerged preview work

This section describes behavior in open pull request #2769, which is not yet in a release.

Some tools are not a browser: a database client or a debugger needs a plain connection. You can forward one port of the other computer to this one.

  1. In the Octant desktop app, choose the other computer in the Environments filter.
  2. On its Running services card, choose Forward port on the row.
  3. Octant says where it listens, for example "Forwarded to localhost:5171 on this computer for an hour. Anything running on this computer can connect to it."

Point your tool at that address. Octant uses the same port number on this computer when it is free, and another free port otherwise.

  • Anything on this computer can connect to it. The forward listens on this computer's 127.0.0.1, so any program here that can open a local connection reaches the other computer's port: a Full access turn, an agent's command you gave a local-service grant for that port, and any process outside Octant's sandbox. Forward only what you are willing to share that way.
  • It lasts one hour. It also closes when the window that opened it closes, when you forget the computer, when this device's access there ends (a revoke, a key rotation, a sign-out, or the listener turned off), and when the other computer stops.
  • Who may. Only the desktop app forwards. A device the other computer's own person paired may forward any port. A restricted device and an agent's access grant are refused.
  • Through the hub. For a computer you reach through the hub, Forward port shows only on a row that belongs to a thread, and works only when that thread's Project is named in the member's Act item. The member checks this when the forward opens and again at every new connection. If the Project is no longer named, the forward closes. It also closes if the server stops or moves to another port. This is in open pull request #2799, which is not yet in a release; until then, a device the hub introduced is refused.
  • Limits: four forwards per device and sixteen per computer, each carrying up to eight connections at a time.

The other computer records each forward's opening and closing with the device and port, never what travels through it.

Limits ​

  • Links to localhost inside the page do not load. The page runs on your computer, so an absolute http://localhost:<port> URL in its HTML, scripts, or data reaches your own loopback, not the host's. The same applies to a sign-in callback registered on localhost and to a second server of the same thread that the page reaches by port.
  • Live reload works, on the page's own address. A dev server's hot-reload socket that connects to the page's own host and port passes through Octant to the other computer, so edits there reload the page here. A hot-reload client set to connect to localhost or a fixed port reaches your own loopback instead, like any other localhost link. Messages are capped at 16 MB, and the socket closes when the server's access ends.
  • A taken local port changes the page's origin. Octant keeps one local port for these pages, from 47610 to 47619. If another program holds it, Octant moves to the next free port in that range, says so once, and pages opened earlier start with empty storage because their origin changed. If the whole range is taken, Open is refused and says so; nothing else in Octant is affected.
  • Octant must stay open. Each request is signed by the Octant window you opened the page from. If you close that window, the page says an Octant window must be open; open the server again from Running services.
  • Open in browser has one residual risk. Browsers send a name's cookies to every port on that name. A process on your computer that gets your browser to request the name on its own port can replay the page's access cookie. What it reaches is that one dev server, for as long as the grant lives, and never Octant authority on either computer. Open in Octant's browser does not have this risk.
  • Limits per device: 8 open servers, 32 concurrent requests, uploads up to 8 MiB.

Ending access ​

Some losses end access the moment they happen, on the host, before the change returns: revoking or rotating the device, the device signing out, its credential expiring, archiving or deleting the thread, and turning the listener off. Open pages then show that this computer no longer has access, and the next request is refused.

Other changes are found when the next request arrives: you lose read access to the thread another way, the server stops, or another process takes its port. The host checks before each request and closes the access then. A process that takes the port in the milliseconds between that check and the connection can receive that one request before the following check closes it. Revoking a device is in Remote Access.

Octant documentation · local-first by design