Feat/ssh local port forwarding#274
Merged
su-fen merged 4 commits intoJul 26, 2026
Merged
Conversation
Introduce desktop-only SSH local forwarding on authenticated terminal sessions, with loopback-only listeners, start/list/stop UI, lifecycle cleanup, and targeted tests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
su-fen
force-pushed
the
feat/ssh-local-port-forwarding
branch
from
July 26, 2026 06:23
e3bd09b to
70c10b1
Compare
Replace the inline three-input forwarding form in each SSH session card with a Cable icon button (left of the close button) that opens a Base UI dialog. The dialog validates the target, probes the requested loopback port over the new terminal_ssh_local_forward_check_port command, and reports a localized "port in use" error before starting; the bind in start remains the authoritative backstop. Mapping rows stay under the card with a Trash2 remove button on the far right.
Relay the four ssh_local_forward_* actions over the existing TerminalRequest channel (proto fields only, no new envelope arm), gate them behind enableWebSshTerminal on both the Go guard and the Rust handler, and fan forward lifecycle events out to gateway subscribers as kind "ssh_local_forward" terminal events. On the web side, mirror sshLocalForwardTypes and a client-injected SshPortForwardDialog (both added to the mirror manifest), add a gateway-backed forward client, and port the tunnel panel UI, i18n copy, and dialog CSS. normalizeTerminalEvent no longer drops session-less forward events.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
为桌面端增加会话级 SSH 本地端口转发(类似
ssh -L),并完成 Windows 下的生命周期与 UX 收尾。在已连接的 SSH 终端会话上,可在本机
127.0.0.1监听端口,经当前 SSH 将会话流量转到远端指定 host:port;会话关闭或应用退出时自动清理。改动内容
127.0.0.1,支持指定本地端口或0自动分配Arc并提供current_handle(),避免建连长时间占锁;close规范化 session id 并清理该会话全部转发terminal_ssh_local_forward_start/list/stop,事件terminal:ssh-local-forward(started / stopped / failed)ssh_local_forward测试任务主要文件
crates/agent-gui/src-tauri/src/runtime/terminal/ssh_local_forward.rsstate.rs/registry.rs/mod.rs/types.rscommands/runtime/terminal.rs、src/lib.rssrc/lib/terminal/sshLocalForwardTypes.ts、tauriSshLocalForwardClient.tssrc/components/project-tools/SshTunnelPanel.tsx安全说明
127.0.0.1)监听ssh -L(remote_host无额外业务白名单)