ProxyCommand impl question #1207
Replies: 3 comments 3 replies
-
@janderssonse I am fairly confident that some projects are using Are you experiencing a specific problem? |
Beta Was this translation helpful? Give feedback.
-
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). |
Beta Was this translation helpful? Give feedback.
-
@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:) |
Beta Was this translation helpful? Give feedback.
-
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?
Beta Was this translation helpful? Give feedback.
All reactions