ProxyCommand impl question #1207
Replies: 4 comments 5 replies
|
@janderssonse I am fairly confident that some projects are using Are you experiencing a specific problem? |
|
Thanks for reply. Yes, I'm using it with proxies for https-calls - that works super today and is not an issue. But what i meant is to when using the underlying ssh client push it through to an ssh-endpoint over https - like ssh.github.com:443, as in the ssh-config example given above, "ProxyCommand".. This can be supported in a few different ways. For a clearer example of the case I'm solving here I'll attach some Go-code. However, this case cant be tested if you dont have proxyserver available to verify that your run is correct. NOTE: this is quite a common scenario and that is why github,gitlab etc have setup enspoints like ssh.github.com:443 and alike. A really simple solution for go-git to allow this scenario, i guess, would be to respect the GIT_SSH_COMMAND variable and accept the command given there, replacing the underlying default ssh-call. Anyways, attaching a go-file example solving this case with a pure git binary call. The ssh-command is using corkscrew, but might as well have used netcat (nc). |
|
@pjbgf I would like to support this use case for a hobby project, https://github.com/itiquette/git-provider-sync but I'll go with git binary workaround for now :/. Still, hoping support for GIT_SSH_COMMAND will be supported in the future:) |
|
One thing that might be worth considering is whether support for ProxyCommand should be implemented directly, or if go-git could expose a more generic mechanism for customizing the underlying SSH dialer/transport. That would cover ProxyCommand, HTTP CONNECT proxies, bastion hosts, SOCKS proxies, and potentially other network topologies without needing to mirror OpenSSH configuration semantics. Has this approach been considered for v6? |
Uh oh!
There was an error while loading. Please reload this page.
Hello!
One quite common scenario is that orgs are blocking port 22 but allowing 443. It is so common that some providers, like github has set upp endpoints for connecting via ssh over 443, ie ssh.github.com. Another common scenario is that all traffic is proxied over https. Now to set this up without go-git and a cli git binary would take somehting like (this is quite common usage):
Host github.com
ProxyCommand nc -X connect -x :8080 %h %p
Hostname ssh.github.com
Port 443
User git
But currently go-git seem to have no support for the ProxyCommand -so, my question is - have anyone implemented ProxyCommand with go-git succesfully, and have some code to share in an open repo for inspiration?
All reactions