git设置代理也不能clone github的东西,这是为什么呢

985 views
Skip to first unread message

hikui miao

unread,
Dec 30, 2014, 2:11:42 AM12/30/14
to sh...@googlegroups.com
公司把VPN封了,所以不能用VPN。
现在主要用shadowsocks翻的,想用ss做git的代理。
尝试了如下方法:

尝试1:
git config --global http.proxy "socks5://127.0.0.1:8387"
git config --global https.proxy "socks5://127.0.0.1:8387"

clone的结果是:
error: RPC failed; result=52, HTTP code = 0
fatal: The remote end hung up unexpectedly

尝试2:
用polipo把shadowsocks作为parent proxy,转成http proxy

设置
➜  ~  git config --global https.proxy "http://127.0.0.1:17070"
➜  ~  git config --global http.proxy "http://127.0.0.1:17070"

clone 一直没有进度。

Wu Jiang

unread,
Dec 30, 2014, 2:27:07 AM12/30/14
to sh...@googlegroups.com, hikui miao
最好用fiddler或者wireshark抓一下包,看看具体的http请求。另外github支持使
用443端口的ssh,
https://help.github.com/articles/using-ssh-over-the-https-port/

吴江

On 12/30/2014 03:11 PM, hikui miao wrote:
> 公司把VPN封了,所以不能用VPN。
> 现在主要用shadowsocks翻的,想用ss做git的代理。
> 尝试了如下方法:
>
> 尝试1:
> git config --global http.proxy "socks5://127.0.0.1:8387
> <http://127.0.0.1:8387>"
> git config --global https.proxy "socks5://127.0.0.1:8387
> <http://127.0.0.1:8387>"
>
> clone的结果是:
> error: RPC failed; result=52, HTTP code = 0
> fatal: The remote end hung up unexpectedly
>
> 尝试2:
> 用polipo把shadowsocks作为parent proxy,转成http proxy
>
> 设置
> ➜ ~ git config --global https.proxy "http://127.0.0.1:17070"
> ➜ ~ git config --global http.proxy "http://127.0.0.1:17070"
>
> clone 一直没有进度。
>
> --
> -- You received this message because you are subscribed to the Google
> Groups Shanghai Linux User Group group. To post to this group, send
> email to sh...@googlegroups.com. To unsubscribe from this group, send
> email to shlug+un...@googlegroups.com. For more options, visit
> this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
> ---
> 您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User
> Group”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到
> shlug+un...@googlegroups.com
> <mailto:shlug+un...@googlegroups.com>。
> 要查看更多选项,请访问https://groups.google.com/d/optout

DaboD

unread,
Dec 30, 2014, 2:51:19 AM12/30/14
to sh...@googlegroups.com
如果 clone/pull/push 時用的 protocol 是 ssh://, 可用 nc 代連 socks5 proxy, 設定方式可參考這頁
http://cms-sw.github.io/tutorial-proxy.html

XiongJia Le

unread,
Dec 30, 2014, 3:00:06 AM12/30/14
to sh...@googlegroups.com
启用  GIT_CURL_VERBOSE 环境变量,看一下 GIT Clone 时错在哪里

比如:

export GIT_CURL_VERBOSE=1
git clone http://xxx

这时 clonse 时会有 download / proxy 的 log




--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

依云

unread,
Dec 30, 2014, 3:12:22 AM12/30/14
to sh...@googlegroups.com
On Tue, Dec 30, 2014 at 03:11:37PM +0800, hikui miao wrote:
> 公司把VPN封了,所以不能用VPN。
> 现在主要用shadowsocks翻的,想用ss做git的代理。

既然有 socks5 代理,直接用 proxychains 嘛。


--
Best regards,
lilydjwg

AR

unread,
Dec 30, 2014, 3:26:30 AM12/30/14
to sh...@googlegroups.com
2014-12-30 16:11 GMT+08:00 依云 <lily...@gmail.com>:
> On Tue, Dec 30, 2014 at 03:11:37PM +0800, hikui miao wrote:
>> 公司把VPN封了,所以不能用VPN。
>> 现在主要用shadowsocks翻的,想用ss做git的代理。
>
> 既然有 socks5 代理,直接用 proxychains 嘛。

+1

$ proxychains git ...

--
Silence is golden.

DaboD

unread,
Dec 30, 2014, 4:02:59 AM12/30/14
to sh...@googlegroups.com
原來還有這玩意, 受教了

Chaos Eternal

unread,
Dec 30, 2014, 4:24:19 AM12/30/14
to sh...@googlegroups.com
不是这么玩的。
如果是SS或者socks代理的话
用 GIT_PROXY_COMMAND=/home/chaos/bin/git-proxy
然后该command是一个脚本:
#!/usr/bin/env guile
!#
(use-modules (scsh syntax))
(define cmd-line (cdr (command-line)))
(let ((ip (car cmd-line))
(port (cadr cmd-line)))
(run (socat "-" ,(format #f "socks4:127.0.0.1:~a:~a,socksport=8387"
ip port))))

我翻译成bash如下:

#!/bin/sh

IP=$1
PORT=$2
socat - socks4:127.0.0.1:$IP:$PORT,socksport=8387


当然,需要安装socat
不过改成nc也可以的。

Chaos Eternal

unread,
Dec 30, 2014, 4:31:04 AM12/30/14
to sh...@googlegroups.com
漏写export


export GIT_PROXY_COMMAND=/home/chaos/bin/git-proxy

hikui miao

unread,
Dec 30, 2014, 7:01:34 AM12/30/14
to sh...@googlegroups.com
好像还是不行啊,我clone https的话,还是


error: RPC failed; result=52, HTTP code = 0
fatal: The remote end hung up unexpectedly
漏写export


export GIT_PROXY_COMMAND=/home/chaos/bin/git-proxy
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。

Shell Xu

unread,
Dec 30, 2014, 10:01:35 PM12/30/14
to shlug
兄弟,你想折腾么?你要实在不想折腾,我给你个建议。
openvpn tcp mode over shadowsocks proxy

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout



--
彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
blog: http://shell909090.org/blog/

Chaos Eternal

unread,
Dec 30, 2014, 11:56:41 PM12/30/14
to sh...@googlegroups.com
你确定装了socat么?

你怎么做的可以详细描述一下么

杨毅涛

unread,
Dec 31, 2014, 10:38:27 AM12/31/14
to sh...@googlegroups.com

公司连VPN都封,无法想象。我现在的公司不会翻墙或者开VPN的话,连邮件之类的系统都不能用。

建议你和贵司boss商量一下。不开VPN就罢工。或者换地方。

hikui miao

unread,
Jan 2, 2015, 9:02:03 AM1/2/15
to sh...@googlegroups.com
最后一个月了。

hikui miao

unread,
Jan 2, 2015, 9:02:46 AM1/2/15
to sh...@googlegroups.com
最后还是用了openvpn via shadowsocks,真是神技啊。。

adam.huang

unread,
Jan 12, 2015, 3:55:34 AM1/12/15
to hikui miao, sh...@googlegroups.com
shadowsocks 和 pdns + dnsmasq + route 来做全局路由透明代理非常爽啊。。。

魔豆路由上有个app,设置下帐号密码就好了。

— 




在 2015年1月2日 22:02:43, hikui miao (hiku...@gmail.com) 写到:

Reply all
Reply to author
Forward
0 new messages