Skip to content

feat: forward the Agent's ports while run or attach is connected - #139

Merged
ado11231 merged 2 commits into
masterfrom
feat/auto-forward
Oct 18, 2026
Merged

ado11231 merged 2 commits into
masterfrom
feat/auto-forward

Conversation

@ado11231

Copy link
Copy Markdown
Owner

Step 3 of #9.

  • While ally run or ally attach is connected, every port that Ally's work or a Docker container listens on opens at localhost on the Client.
  • A port taken on the Client moves to the next free one. Forwards listen on 127.0.0.1 only and end with the port or the command.
  • Sessions show the ports in the bar, with a short message for each new one.
  • Only one Ally command forwards each port. Another takes over when it ends.

Tested on archbox over the local network: run, a taken port, attach, two runs at once, and a killed holder. Tailnet, iroh, and a running Docker container not tested.

A server started on the Agent should open in the Client's browser with no setup. While run or attach is connected, the Client asks the Agent for ports every 2 seconds and adds each one to the shared ssh connection with ssh -O forward, on 127.0.0.1 only, moving to the next free port when one is taken. Each port is claimed with a lock so only one Ally command forwards it, and a command still running takes over when the holder ends. Sessions show the ports in the bar.
@ado11231
ado11231 merged commit 520c1cf into master Oct 18, 2026
2 checks passed
@ado11231
ado11231 deleted the feat/auto-forward branch October 18, 2026 04:13
@ado11231 ado11231 mentioned this pull request Oct 18, 2026
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.

1 participant