Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

各类软件设置代理 #216

Open
Bpazy opened this issue Jan 11, 2022 · 3 comments
Open

各类软件设置代理 #216

Bpazy opened this issue Jan 11, 2022 · 3 comments

Comments

@Bpazy
Copy link
Owner

Bpazy commented Jan 11, 2022

Git 设置全局代理

如果克隆的是 http 或 https 仓库,则:

git config --global https.proxy http://127.0.0.1:7890
git config --global https.proxy https://127.0.0.1:7890

如果克隆的是 ssh 协议,则需要编辑 ~/.ssh/config,形如:

Host github.com
    HostName github.com
    IdentityFile ~/.ssh/id_rsa_github
    ProxyCommand connect -H 127.0.0.1:7890 %h %p

如果 ssh 的 22 端口被封禁,导致 github push/pull 失败,可以通过配置文件的方式更改端口

Host github.com
    HostName ssh.github.com
    Port 443
    IdentityFile ~/.ssh/id_rsa_github
    ProxyCommand connect -H 127.0.0.1:7890 %h %p
@Bpazy Bpazy added the git label Jan 11, 2022
@Bpazy
Copy link
Owner Author

Bpazy commented Jan 11, 2022

Windows 设置代理

添加环境变量:

set http_proxy socks5:127.0.0.1:7890
set https_proxy socks5:127.0.0.1:7890

@Bpazy Bpazy changed the title Git 设置代理 各类软件设置代理 Jan 11, 2022
@Bpazy
Copy link
Owner Author

Bpazy commented Jan 11, 2022

Yarn 设置代理

yarn config set proxy http://127.0.0.1:7890
yarn config set https-proxy http://127.0.0.1:7890

@Bpazy
Copy link
Owner Author

Bpazy commented Jan 17, 2022

golang 设置代理

go env -w GOPROXY=https://goproxy.cn,direct

@Bpazy Bpazy removed the git label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant