Git 和 http_proxy(Windows 上的 SparkleShare 和 http_proxy)

发布于 2024-12-24 00:14:30 字数 918 浏览 0 评论 0原文

我刚刚根据指南成功构建了适用于 Windows 的 SparkleShare:

https://github.com/wimh/SparkleShare/ wiki

并将我的 ssh 公钥导出到服务器。 问题是我无法从 http_proxy 后面的客户端连接到在自定义端口上运行 ssh 的公共服务器。我在克隆任何 git 服务器时也遇到了问题。我需要将 git:// 协议切换为 http:// 协议。有什么建议吗?有人有类似的经历吗?

这是一个日志文件:

15:25:13 [SSH] ssh-agent 已启动,PID=4380 添加身份: C:\Users\MYUSER\AppData\Roaming\sparkleshare\sparkleshare.MYEMAIL.key (C:\Users\sg0922706\AppData\Roaming\sparkleshare\sparkleshare.MYEMAIL.key) 15:25:34 [Fetcher][C:\Users\MYUSER\Documents\SparkleShare.tmp\share] 获取文件夹: ssh://MYGITUSER@MYHOST/MYPATH 15:25:34 [Fetcher] 禁用主机密钥检查 MYHOST 15:25:34 [Cmd] git clone --progress “ssh://MYGITUSER@MYHOST/MYPATH”“C:\Us ers\MYUSER\Documents\SparkleShare.tmp\share" 15:25:37 [Git] 退出代码 128 15:25:37 [Fetcher] 失败 15:25:37 [Fetcher] 启用主机密钥 检查 MYHOST

I've just successfully built SparkleShare for windows according to guide:

https://github.com/wimh/SparkleShare/wiki

and exported my ssh public key to a server.
The problem is that I can't connect from a client behind a http_proxy to a public server with ssh running on a custom port. I had also problem with cloning any git server. I need to switch git:// protocol to http:// one. Any suggestion? Does anyone have similar experience?

This is a log file:

15:25:13 [SSH] ssh-agent started, PID=4380 Identity added:
C:\Users\MYUSER\AppData\Roaming\sparkleshare\sparkleshare.MYEMAIL.key
(C:\Users\sg0922706\AppData\Roaming\sparkleshare\sparkleshare.MYEMAIL.key)
15:25:34 [Fetcher][C:\Users\MYUSER\Documents\SparkleShare.tmp\share]
Fetchin g folder: ssh://MYGITUSER@MYHOST/MYPATH 15:25:34 [Fetcher]
Disabled host key checking MYHOST 15:25:34 [Cmd] git clone --progress
"ssh://MYGITUSER@MYHOST/MYPATH" "C:\Us
ers\MYUSER\Documents\SparkleShare.tmp\share" 15:25:37 [Git] Exit code
128 15:25:37 [Fetcher] Failed 15:25:37 [Fetcher] Enabled host key
checking for MYHOST

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

秉烛思 2024-12-31 00:14:30

我有一个解决这个特定问题的方法。我猜您已经通过简单的 SSH 客户端(即 PuTTY)成功连接到您的服务器?使用 PuTTY,您可以通过任何类型的代理(例如 HTTP、SOCKS、Telnet 等)轻松配置 ssh 连接。

您现在可以做的是指定本地“隧道”(SSH 端口转发规则),如下所示:L22 127.0.01:22(见附件)。如果您使用 ssh 命令行,请添加以下选项:-L 22:127.0.01:22。

PuTTY 中的本地隧道

因此,现在只要您的终端打开并运行,您就可以通过以下方式访问您的 git 服务器服务器网址: ssh://[电子邮件受保护]

如果您的本地端口 22 繁忙,您可以在其他端口上定义隧道。即如果44未被占用:L44 127.0.0.1:22。 SparkleShare 中使用的 URL 变为 ssh://[email protected]: 44.

in SparkleShare

但这是一种解决方法。我正在寻找更好的解决方案。

I have a work around on this particular problem. I guess that you already successfully connected to your server via a simple SSH client (i.e. PuTTY)? With PuTTY you can easily configure an ssh connection via any kind of proxy (such as HTTP, SOCKS, Telnet, ..)

What you can do now is to specify a local "tunnel" (an SSH port forwarding rule) like this: L22 127.0.01:22 (see attachment). If you are using a ssh command line add the following option: -L 22:127.0.01:22.

Local tunnel in PuTTY

So now as soon as your terminal is open and running you'll be able to reach your git server via the server url: ssh://[email protected].

If your local port 22 is busy you can define the tunnet on a other port. i.e. if the 44 is not occupied: L44 127.0.0.1:22. The url to use in SparkleShare become ssh://[email protected]:44.

in SparkleShare

But it's a work around. I'm looking for a better solution.

牵你手 2024-12-31 00:14:30

要让 SparkleShare 使用您的代理,您需要修改作为 SparkleShare 的一部分安装的 msysgit 的配置。导航到 C:\Program Files (x86)\SparkleShare\msysgit\etc 并在记事本中编辑 gitconfig 文件,然后在 [http] 标记下添加以下行,

proxy = http://user:pass@proxyurl:port

修改url 根据需要匹配您的设置。然后,您可以使用“在我自己的服务器上”选项添加存储库的 http url。

To get SparkleShare to use your proxy you will need to modify the config of the msysgit that is installed as part of SparkleShare. Navigate to C:\Program Files (x86)\SparkleShare\msysgit\etc and edit the gitconfig file in notepad and add the following line under the [http] tag

proxy = http://user:pass@proxyurl:port

modifying the url as required to match your settings. You can then use the "On my own server" option to add the http url of your repository.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文