Conversation
feat(proxy): connection proxy support (HTTP CONNECT / SOCKS5, per-host)
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
Adds a per-host outbound proxy so SSH hosts on restricted networks can be reached through an HTTP CONNECT or SOCKS5 proxy. Applies to local-originated TCP dials (direct target + first bastion) and complements the existing jump chain. Closes #74.
Changes
proxy_settings.dart—ProxyTypeenum (none/http/socks5) +ProxySettingsvalue.proxy_handshake.dart— pureByteReader+httpConnectHandshake(Basic auth, 200 check) +socks5Handshake(RFC 1929 auth, ATYP-domain remote DNS, reply-code messages) +ProxyException. Over-read bytes are preserved so the SSH banner isn't lost.connection_proxy.dart—ConnectionProxy.connectdials the proxy, runs the handshake, returns a_ProxiedSocket(anSSHSocket) that re-emits the leftover ahead of live data; destroys the socket on failure; optional whole-operation timeout.Host—proxyType/proxyHost/proxyPort/proxyUsername(sync round-trip, unknown type → none). Proxy password in secure storage (proxy_pw_<id>), never in JSON.SshService—loadProxyPassword/saveProxyPassword, injectabledirectDialer/proxyDialer, andlocalDialwired into the three local-originated dial sites (connect,dialHophop0,testConnection). No dartssh2 fork change.Type of change
feat— new featureHow was this tested?
cd app && flutter analyze— no new warnings (6 touched files clean)cd app && flutter test— 18 new tests (settings 2, HTTP 3, SOCKS5 4, proxy socket 1, host 4, ssh_service 2, panel 2) + full host-panel +test/models/(189) regression passssh -D 1080for SOCKS5, tinyproxy for HTTP CONNECT)Security notes
ProxyExceptionwith a clear message; the proxy socket is destroyed on any failure.Checklist