Skip to content

Conversation

@NalinG
Copy link

@NalinG NalinG commented Dec 20, 2021

Usually, you cannot initiate an SSH connection via a non-standard transport( here: HTTP Connect). This change adds a Protocol class which allows you to ssl to a proxy host and then send an HTTP Connect request to the target host. After that, you can setup an SSH connection over the tunnel.

I haven't added any tests yet as I wanted to check in with the maintainer about the method and plausibility of adding this to the asyncssh lib.

@ronf
Copy link
Owner

ronf commented Dec 21, 2021

Thank you for the submission, but I'm not sure this code really belongs in AsyncSSH itself. There are MANY different ways to tunnel traffic -- SOCKS, Proxy Protocol, and HTTP CONNECT all come to mind, and that's far from a complete list. Rather than growing the AsyncSSH code to include all of these and more, I tried to provide a general mechanism that would allow a caller to implement tunneling code (much like you did here) in their own application, with AsyncSSH then using that object in place of a standard TCP socket object. I also recently provided a way to allow the tunneling code to run in a separate process, for cases where someone wanted to tunnel using code not written in Python.

You can find an example of creating a SOCKS tunnel and some other related discussion of the more generic ProxyCommand support in #376.

@NalinG
Copy link
Author

NalinG commented Dec 21, 2021

Makes sense, thank you for the reply. We can probably close the PR.

@NalinG NalinG closed this Dec 21, 2021
@NalinG NalinG deleted the http_connector branch December 21, 2021 16:46
@NalinG NalinG restored the http_connector branch December 21, 2021 16:46
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