Repository navigation
Automatic port forwarding #9
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
What
A server started on the Agent, such as npm run dev on port 5173, opens at localhost:5173 on the Client with no setup.
Today
- ssh shares one connection across calls only over iroh, through
RemoteCommand.sharedincrates/ally-cli/src/ssh.rs. Direct routes open a new connection each time. RemoteCommand.forwardforwards one fixed port for a whole command, used only to sign in to tools.- Nothing lists the ports work on the Agent listens on.
How
- Share the ssh connection on every route, not only iroh, so ports can be added to it while it runs.
- The Agent reports listening ports. A new
Request::Portsreturns each TCP port that a process in an Ally job listens on: port, bind address, job, and program. It wrapssson Linux andlsofon a macOS Agent, and matches processes to jobs through their process tree. Ports that Docker containers publish are included, labeled Docker. Raisescontrol::VERSION. - Automatic forwarding during
ally runandally attach.- The Client asks for ports every 2 seconds over the open control connection, adds each new one with
ssh -O forward -L, and removes it withssh -O cancelwhen it closes. - Forwards last only while
runorattachis connected. - Forwards listen on
127.0.0.1only, and target the address the server listens on (127.0.0.1or[::1]). - If the port is taken on the Client, the next free one is used and named.
runprints▶ Forwarding archbox:5173 to localhost:5173once.- In
attach, the session bar lists the ports, and a short tmux message appears when one is added.
- The Client asks for ports every 2 seconds over the open control connection, adds each new one with
ally forward <port>forwards any Agent port until Ctrl C, for a server left running after detaching.ally portslists what is forwarded.- Menu bar. Lists forwarded ports, and a click opens the browser. Notifies the first time a job listens on a port, with the address to open.
The waiting for input notification moved to #136.
Done When
- A server started in a run or a session opens in the Client's browser over the local network, tailnet, and iroh.
- A port a Docker container publishes opens on the Client.
- Ollama's port 11434 opens on the Client.
- Starting
npm run devin a session notifies with the address to open.
Folds in #21.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
ado11231 commentedon Oct 1, 2026
Notes From October 1, 2026
docker run -p 5432:5432opens its port from Docker's own processes, which are not in any job, so it would be missed. Forward the ports Docker publishes too, for example fromdocker ps --format '{{.Ports}}', run on the Agent like any other command.127.0.0.1:11434on the Agent. Any tool on the Client that talks to Ollama, and a browser UI such as Open WebUI, needs this forward. Tools run insideslingshot attachdo not, because therelocalhostis the Agent.ado11231 commentedon Oct 18, 2026
Status On October 18, 2026
All five steps are built and merged:
runandattachally forwardandally portsLeft Before Closing
runandattachdo not forward it;ally forward 11434does.Known Behavior