Chapter 06

SSH tunnels

Per-connection local port forwarding, managed from the sidebar and synchronised by a backend event.

What is supported

Local port-forwarding rules are stored per connection. They can be added, edited, deleted, started and stopped from the sidebar. Because tunnels are carried by the SSH session itself, they reuse the same russh channel as the terminal.

State synchronisation

When tunnel state changes, the backend emits tunnel-changed and the sidebar updates the live status, even when the tab that carried the tunnel has disconnected.

Using a tunnel

A rule has four fields: local bind address (default 127.0.0.1), local port, remote host and remote port. Create a rule for a connection, start it from the sidebar, and connections to the local port are relayed to the remote target.

Operational note. A tunnel lives on the SSH session that owns it, so it stops when the session closes; the connection-closed status on the tab is the signal to watch.