Skip to content

fix(connections): apply advanced SSH and proxy options to live connections - #73

Open
sunxiaobin89 wants to merge 2 commits into
GOODBOY008:mainfrom
sunxiaobin89:fix/advanced-tab-config-not-saved
Open

fix(connections): apply advanced SSH and proxy options to live connections#73
sunxiaobin89 wants to merge 2 commits into
GOODBOY008:mainfrom
sunxiaobin89:fix/advanced-tab-config-not-saved

Conversation

@sunxiaobin89

@sunxiaobin89 sunxiaobin89 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

The Advanced tab (compression, keepAlive, keepAliveInterval, serverAliveCountMax) and Proxy tab (proxyType, proxyHost, proxyPort, proxyUsername, proxyPassword) settings in the connection dialog are now persisted and actually applied to live SSH connections. Previously they were silently dropped on save and never sent to the backend, so they had no effect.

Root cause

  1. PersistenceConnectionData had no proxy/advanced fields, every save path omitted them, and the duplicated ConnectionData → ConnectionConfig constructions never read them back.
  2. Application — the backend ConnectRequest/SshConfig had no such fields, SshClient::connect hardcoded keepalive to 60 s / 3, compression was never negotiated, and there was no proxy tunneling. All 7 frontend ssh_connect call sites only sent the basic connection fields.

Changes

  • connection-storage.ts / connection-dialog.tsx / App.tsx — persist proxy + advanced SSH fields across save/edit; mergeWithDefaults keeps legacy connections showing sensible defaults; toConnectionConfig centralizes loading.
  • ssh-connect-request.ts (new) — single helper that carries advanced + proxy values into every ssh_connect request, replacing 7 duplicated payloads.
  • ssh/mod.rsSshConfig gains compression, keepalive, and proxy fields; SshClient::connect applies the user's keepalive interval/max, negotiates zlib compression (advertised before none so it is actually selected), and tunnels through HTTP/SOCKS4/SOCKS5 proxies when configured.
  • commands.rs / proxy.rs (new)ConnectRequest accepts the new fields; proxy.rs implements HTTP CONNECT and SOCKS4/SOCKS5 handshakes.
  • Tests — storage round-trip, dialog save/fallback, edit round-trip, proxy handshake (HTTP/SOCKS4/SOCKS5 incl. auth and error paths), and compression preference tests.

Testing

  • 526 frontend tests pass (10 new), tsc --noEmit clean.
  • 122 Rust tests pass (16 new), cargo clippy clean.
  • Note: proxy tunneling and zlib compression are covered by unit tests (handshake/negotiation logic); end-to-end verification against a real proxy or SSH server is recommended during release testing.

Closes #74

…edit

- Add proxy and advanced SSH fields to ConnectionData so they survive
  storage round trips
- Include these fields in every save path in ConnectionDialog (edit save,
  new connect, SSH/SFTP/FTP/Desktop branches)
- Add toConnectionConfig helper in App.tsx to carry the fields when
  opening the edit dialog, replacing 9 duplicated ConnectionConfig builds
- Merge undefined fields back to defaults when editing legacy connections
  saved before these fields were persisted, so the Advanced/Proxy tabs
  show the same pre-filled values as new connections

Test: 516 tests pass, 6 new tests cover persistence and default fallback
The Advanced (compression, keepalive) and Proxy tabs in the connection
dialog were persisted but never reached the backend, so they had no
effect on real SSH connections.

- Add keepalive interval/max, zlib compression negotiation, and
  HTTP/SOCKS4/SOCKS5 proxy tunneling to the SSH backend
  (new proxy.rs, SshConfig/ConnectRequest fields, SshClient::connect)
- Wire the stored advanced/proxy values through every ssh_connect call
  via a shared buildSshConnectRequest helper, replacing 7 duplicated
  request payloads
- Fix compression negotiation: advertise zlib before none so russh
  actually negotiates zlib instead of always falling back to none
- Add proxy handshake tests (HTTP CONNECT, SOCKS4, SOCKS5 incl. auth and
  error paths), compression preference tests, and edit round-trip
  regression tests

Test: 526 frontend tests pass (10 new), 122 Rust tests pass (16 new)
@sunxiaobin89 sunxiaobin89 changed the title fix(connections): persist advanced SSH and proxy options across save/edit fix(connections): apply advanced SSH and proxy options to live connections Jul 31, 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.

Advanced tab settings are not applied to SSH connections

1 participant