ProxyCommnad support

50 views
Skip to first unread message

tha...@codescalers.com

unread,
Sep 25, 2016, 9:16:36 AM9/25/16
to asyncssh-users
Hello, Thanks for the wonderful project.

I'm wondering if there's a way to use ProxyCommand in asyncssh? or is it planned if not supported yet?

Thanks.

Ron Frederick

unread,
Sep 25, 2016, 12:51:22 PM9/25/16
to tha...@codescalers.com, asyncssh-users
Hello,
There isn’t a way to do this directly right now. It would be possible to support it in a fashion similar to what I added for supporting SSH tunnel (jump hosts), but I’d be a bit hesitant to actually do it by forking and exec’ing a separate process for each connection which ran an arbitrary command, as that would take away a lot of the scalability benefit AsyncSSH provides by allowing many different SSH connections to all be handled in a single process.

Is there a specific kind of proxy capability you are looking for? If it is something that can be implemented directly in Python as an asyncio transport, it would be possible to support the proxy and still maintain AsyncSSH's scalability, like i did for SSH jump hosts. I could probably generalize that to support executing external commands as well for cases where scalability isn’t a concern.

One thing you could do for now is to pass in an already open socket to asyncssh.create_connection(). So, for instance, if you needed to connect to a proxy and send it an HTTP “CONNECT” request before you started sending SSH messages, you could write code which did that and read back the “200 OK” response and then passed that connected socket into AsyncSSH.
--
Ron Frederick
ro...@timeheart.net



Reply all
Reply to author
Forward
0 new messages