himanshub16 / ProxyMan

Configuring proxy settings made easy.
https://github.com/himanshub16/ProxyMan/releases/latest/
MIT License
690 stars 107 forks source link

Support for SSH #101

Open mustafagonul opened 4 years ago

mustafagonul commented 4 years ago

The ssh configuration can be as follows:

# Github
Host github.com
    User git
    HostName github.com
    IdentityFile ~/.ssh/id_rsa_gitall
    ProxyCommand socat - PROXY:<proxy>:%h:%p,proxyport=<port>

# Gitlab
Host gitlab.com
    User git
    HostName altssh.gitlab.com
    Port 443
    IdentityFile ~/.ssh/id_rsa_gitall
    ProxyCommand socat - PROXY:<proxy>:%h:%p,proxyport=<port>

I appreciate it if the can support edit/change .ssh/config file.

himanshub16 commented 4 years ago

This seems doable, given the end-user is confident enough to make this particular change to each of their ssh config. I guess there can be cases where the config is for another machine on a private network, and connecting doesn't require proxy with SSH.

Considering this, we can have it exempted from all option and make the user run it manually when needed. Thoughts?

mustafagonul commented 4 years ago

I agree with you. This should be done separately from all configuration. ProxyMan should have two kinds of configuration. The first type of configurations can be included in all, the second type of configurations are not included in all configuration. The options should be listed separately so that the user can identify the difference.

Besides this topic, I would like to say something regarding the ssh. If the ssh option is selected, ProxyMan should list all the ssh configuration and the user should select which one she wants to be edited.

mustafagonul commented 4 years ago

After some investigation, I guess the best way is to implement this feature writing a wrapper script and assigning this wrapper script into git configuration or setting the GIT_PROXY_COMMAND environment. That also means that I don't think managing ssh configurations separately is necessary.

Setting GIT_PROXY_COMMAND in bashrc and zshrc can be better.

Please check the following links: