公司提供了 VPN ,但是只能全局代理,个人感觉不安全,并且深信服口碑不咋地,于是我在 docker 中启动 vpn ,并向外提供一个 sock5 代理,我希望 go get ≈<private_repo_path>` 走我本地启动的这个 sock5 代理
Go env
GOPRIVATE="公司 Gitlab.net"
GOPROXY="http://goproxy.cn,direct"
Git 配置
[http "https://公司 Gitlab.net"]
proxy = socks5://127.0.0.1:1080
[url "ssh://git@公司 Gitlab.net"]
insteadOf = http://公司 Gitlab.net/
[url "git@sc.happyelements.net:"]
insteadOf = http://公司 Gitlab.net/
netrc 配置
machine 公司 Gitlab.net
login username
password accessToken
我期望 git clone 公司 Gitlab/repo_name
命令走我启动的 sock5 代理,目前已经成功, 因为我配置了 git 的 http 代理。
但是 go get 公司 Gitlab/repo_name
时显示超时
了解到 go get
本质上是 git clone
并且我设置了 ssh insteadOf http 时,我认为我应该配置一个 SSH 的代理
于是我在 .ssh/config
增加了以下配置
Host 公司 Gitlab.net
ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p
但是并不起作用
go get Gitlab.net/repo_name
时显示
go get: unrecognized import path "公司 Gitlab.net/golang/base": https fetch: Get "https://公司 Gitlab.net/golang/base?go-get=1": dial tcp 10.130.xxx.xxx:443: i/o timeout
看了下 10.130.xxx.xxx 应该是公司 Gitlab.net 的内网 IP ,请问我该怎么办?
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.