Skip to content

Commit de970d3

Browse files
fix: use actual daemon URL for proxy lookup in SSH connections
Previously, SSH connections used a hardcoded dummy host 'http://docker.example.com' for the ConnectionHelper, which meant proxy configuration had to use this dummy URL instead of the actual daemon URL. Now, the actual daemon URL (e.g., 'ssh://user@host.com') is used, allowing users to configure proxies with their actual endpoint URLs in config.json. Before: User configures: {"proxies": {"ssh://user@host.com": {...}}} - doesn't work Only works with: {"proxies": {"http://docker.example.com": {...}}} After: User configures: {"proxies": {"ssh://user@host.com": {...}}} - works! Fixes: #7046 Signed-off-by: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 1d1562e commit de970d3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cli/connhelper/connhelper.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func getConnectionHelper(daemonURL string, sshFlags []string) (*ConnectionHelper
6565
Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) {
6666
return commandconn.New(ctx, "ssh", sshArgs...)
6767
},
68-
Host: "http://docker.example.com",
68+
Host: daemonURL,
6969
}, nil
7070
}
7171
// Future version may support plugins via ~/.docker/config.json. e.g. "dind"
@@ -74,6 +74,8 @@ func getConnectionHelper(daemonURL string, sshFlags []string) (*ConnectionHelper
7474
}
7575

7676
// GetCommandConnectionHelper returns Docker-specific connection helper constructed from an arbitrary command.
77+
// Note: Host is set to a default value since we don't have information about the target daemon.
78+
// Users should configure proxies for this default host in their config.json if needed.
7779
func GetCommandConnectionHelper(cmd string, flags ...string) (*ConnectionHelper, error) {
7880
return &ConnectionHelper{
7981
Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) {

0 commit comments

Comments
 (0)