[Feature Request] - Proxy support
Description
Proxy support would be a valuable feature for termscp as it would allow users to route their SFTP/SCP traffic through proxy servers, enhancing security and enabling access in network-restricted environments. Adding this feature to termscp would make it more versatile and useful in various network environments.
Thank you for considering this feature request, and please let me know if you have any questions or need further clarification.
Changes
- Proxy Support: Implement the ability to configure and use proxy servers for SFTP and SCP connections. This should include support for various types of proxies, such as SOCKS and HTTP proxies.
Implementation
-
Proxy Configuration: Add a dedicated section in the client's configuration file where users can specify proxy settings. This should include options for proxy type (e.g., SOCKS5, HTTP), proxy server address, port, and proxy authentication details. Additionally, the client should automatically detect and respect existing environment variables such as http_proxy, https_proxy, and others for proxy configuration, making it convenient for users who have these variables set in their environment.
-
Command-Line Options: Allow users to set proxy-related options via command-line arguments when invoking the client. For example, users should be able to specify proxy information when running SFTP or SCP commands.
-
Fallback Mechanism: Implement a fallback mechanism to ensure that the client can work without a proxy if no proxy settings are specified. It should be easy to switch between using a proxy and direct connections.
-
Documentation: Provide comprehensive documentation that explains how to configure and use the new proxy support feature. This should include examples and best practices for different proxy server types.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.
Wow, really nice!!! Someone opens an issue, simply ignore it until the bot closes it!!!!
@farzadmf then implement yourself. Everybody can contribute to the project, not just me. If nobody has ever opened a PR it means that there's no interest in it. Just for the record then, it's not supported by the ssh2-rs lib as far as I know. I want also to remind you that I don't get paid for this.
Yeah, sorry @veeso ; you're right; I was a bit tired trying different things and see them not working because of this feature. I apologize.
Unfortunately, at least for now, I just needed something to work with my setup, without me needing to invest on it (of course, it doesn't help that I'm not super efficient with Rust).
I was so happy to find this, and then I realized it doesn't work with my setup, hence the message. I apologize again, and I just did what I hate other people doing, sorry!
@veeso hey, thanks for letting us know. I got it working with proxychains for my use case. Might give that a try @farzadmf
@slax-creator Interesting! How did you do it?
I have this in my config (termscp's config has set to its path):
Host myhost
HostName <the-actual-host-name>
User farzadmf
ProxyCommand=<proxy-command> %h
ControlPath <control-masters>-%C
ControlMaster auto
ControlPersist 30m
ServerAliveInterval 15
ServerAliveCountMax 44
RemoteForward [localhost]:<local-port> [localhost]:<local-port>
And when I do termscp myhost, it's giving me an error saying
IO error (Could not parse configuration file: expected port number)
@farzadmf so I use wsl2 on my windows laptop at work. I don't think I have changed anything in my termscp config other than point it to my .ssh/config (which honestly I don't think it uses anything from that).
I also run cntlm proxy in wsl2 to access our corporate proxy through which I can access some systems - cntlm proxy listens on port 3128.
Then in my /etc/proxychains.conf I have: http 127.0.0.1 3128 Dns 1.2.3.4 (whatever your DNS server is)
And then I just do: proxychains termscp
I can't get DNS to resolve though, so I just use IPs for the systems I need to access behind that proxy - but it works just fine for me.
Hope that helps.