Skip to content

Enable connections via a proxy#112

Open
timlyo wants to merge 2 commits into
Miyoshi-Ryota:mainfrom
timlyo:client-connect-via
Open

Enable connections via a proxy#112
timlyo wants to merge 2 commits into
Miyoshi-Ryota:mainfrom
timlyo:client-connect-via

Conversation

@timlyo

@timlyo timlyo commented Feb 11, 2026

Copy link
Copy Markdown

This PR adds functionality for SSH'ing to a remote host via an SSH proxy.

I implemented this feature for my own project, happy to discuss changing any details if you're interested in merging it.

@timlyo timlyo force-pushed the client-connect-via branch 2 times, most recently from dd4d781 to 5933393 Compare February 13, 2026 13:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements SSH proxy jumping functionality, allowing connections to remote hosts via an existing SSH connection. This is useful for accessing hosts that are only reachable through an intermediate SSH server.

Changes:

  • Added connect_via and connect_via_with_config methods to enable proxy jumping
  • Added test infrastructure (second SSH server container) to validate the proxy jumping feature
  • Added test case to verify proxy jumping works correctly

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/client.rs Implements connect_via and connect_via_with_config methods for proxy jumping, plus test case
tests/docker-compose.yml Adds second SSH server container (ssh-server-2) for proxy jumping tests
tests/async-ssh2-tokio/Dockerfile Adds environment variables for second SSH server configuration
.env Adds environment variables for second SSH server IP and port

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/client.rs
Comment on lines +301 to +303
/// Open a connection to a remote host via an existing connection. Can be
/// used for Proxy Jumping to hosts that are only accessible from a
/// different remote host.

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding more comprehensive documentation for this new public API method, similar to the documentation for the connect method. The documentation should explain what happens when addr yields multiple addresses, how authentication works, and describe the parameters in detail. This would help users understand the proxy jumping feature better.

Copilot uses AI. Check for mistakes.
Comment thread src/client.rs Outdated
Comment thread src/client.rs Outdated
@timlyo timlyo force-pushed the client-connect-via branch from 5933393 to b0dfe14 Compare February 19, 2026 16:50
@timlyo timlyo force-pushed the client-connect-via branch from b0dfe14 to ed33c70 Compare March 4, 2026 15:19
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.

2 participants