Reverse Ports
在 VS Code 底部新增一个采用原生“端口”面板布局的标签页,管理 SSH 反向端口转发。 使用
空列表只显示说明与一个“转发端口”按钮。标签页徽标显示正在运行的转发数量。端口只显示数字;修改本机目标可点击地址旁的编辑图标、双击转发地址或右键选择“更改转发地址”。运行中的规则自动停止、保存并重新连接,停止的规则只保存。修改远程端口后,已有代理终端需重开以使用新变量。 布局保持“端口 / 转发地址 / 正在运行的进程 / 源”四列,没有顶部工具栏、独立表单或常驻说明。当前未探测远程进程,进程列留空;源显示“手动转发”,悬停可查看 SSH 主机。规则存储仍兼容旧版本。 终端代理
复制按钮或右键“复制三行变量”可直接取得:
变量只影响读取它们的程序,不自动代理已启动进程、系统服务或容器。复制命令适用于远程 Linux 的 sh/Bash。 认证与设置
开发与测试
打开源码目录按 F5 调试。
密码认证集成测试使用系统 OpenSSH 与临时 Paramiko SSH 服务端,覆盖直连、单跳、双跳、各级错误密码重试与取消,以及跳板机慢输入。它不修改系统 SSH 服务、用户账号或用户的 known_hosts。Paramiko 服务端接口仅用于测试,不进入扩展安装包。 Windows 可在一个终端启动测试夹具:
再在另一个终端运行 EnglishInstall the VSIX locally and open Reverse Ports in the bottom panel. The view follows VS Code's Ports layout: Port, Forwarded Address, Running Process, and Origin. Click Add Port to edit a row inline. Enter a remote port and optionally a local port or host:port; a blank destination defaults to the same local port and the SSH host is inherited from the current remote workspace (or the first configured SSH host). The port cell contains edit and stop actions; the address cell contains terminal, copy and destination edit actions. Editing a running rule automatically restarts it; stopped rules remain stopped. Reopen existing proxy terminals after changing the remote port. The empty view shows one explanation and a Forward a Port button; the tab badge counts running forwards. Enter or clicking outside the editing row saves; Escape cancels. Clicking between the two creation inputs does not submit. Double-click a row or press F2 to edit. Hover a row to copy proxy exports, open a terminal, or stop/remove the forwarding rule. Right-click Terminal proxy to select a rule. The extension starts the tunnel as needed and automatically opens one new remote terminal once the tunnel and environment are ready. The terminal icon does the same. Repeated state updates or reconnects do not spawn additional terminals. Proxy URLs use the rule's remote listening port, not its local destination port. New terminals inherit HTTP_PROXY, HTTPS_PROXY, NO_PROXY and lowercase equivalents, preserving existing exclusions. Existing terminals must be reopened. Injection is non-persistent and workspace-scoped; explicitly created local terminals in the same remote workspace may inherit it too. The terminal button opens in the verified remote folder. Ordinary local windows, mismatched hosts, WSL and containers do not receive injection. SSH keys, agents, SSH config and ProxyJump remain supported. When OpenSSH requests a password, key passphrase or interactive authentication response, a masked VS Code input box opens, including separate prompts for jump and destination hosts. Credentials are used only for the current authentication and are never saved to configuration or logs. Canceling stops the connection; the startup timeout pauses while waiting for input. Verify host fingerprints in a local terminal before the first connection. No remote files, shell profiles or system settings are modified. Commands for diagnostics and logs remain available in the Command Palette. Chinese/English localization follows VS Code's display language. |