fix(connections): apply advanced SSH and proxy options to live connections - #73
Open
sunxiaobin89 wants to merge 2 commits into
Open
fix(connections): apply advanced SSH and proxy options to live connections#73sunxiaobin89 wants to merge 2 commits into
sunxiaobin89 wants to merge 2 commits into
Conversation
…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)
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.
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
ConnectionDatahad no proxy/advanced fields, every save path omitted them, and the duplicatedConnectionData → ConnectionConfigconstructions never read them back.ConnectRequest/SshConfighad no such fields,SshClient::connecthardcoded keepalive to 60 s / 3, compression was never negotiated, and there was no proxy tunneling. All 7 frontendssh_connectcall sites only sent the basic connection fields.Changes
mergeWithDefaultskeeps legacy connections showing sensible defaults;toConnectionConfigcentralizes loading.ssh_connectrequest, replacing 7 duplicated payloads.SshConfiggains compression, keepalive, and proxy fields;SshClient::connectapplies the user's keepalive interval/max, negotiates zlib compression (advertised beforenoneso it is actually selected), and tunnels through HTTP/SOCKS4/SOCKS5 proxies when configured.ConnectRequestaccepts the new fields;proxy.rsimplements HTTP CONNECT and SOCKS4/SOCKS5 handshakes.Testing
tsc --noEmitclean.cargo clippyclean.Closes #74