Ubuntu设置全局socks代理

Ubuntu设置全局socks代理准备代理服务器略 哎 就是玩儿 设置代理代理命令公式 exportALL PROXY socks5 代理服务器 IP 地址 代理端口 例如 exportALL PROXY socks5 127 0 0 1 1080 取消设置的代理忘了

准备代理服务器

略 (哎!就是玩儿!)

设置代理

代理命令公式

export ALL_PROXY="socks5://代理服务器IP地址:代理端口" 

例如:

export ALL_PROXY="socks5://127.0.0.1:1080" export all_proxy="socks5://127.0.0.1:1080" 
export http_proxy=http://192.168.41.217:10811 export https_proxy=http://192.168.41.217:10811 

取消设置的代理

unset ALL_PROXY unset all_proxy 
unset http_proxy unset https_proxy 

git设置代理

首先确认ip和端口,例如ip为127.0.0.1, 端口为1080, 打开终端,运行以下命令:

git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks5://127.0.0.1:1080' 

查看:

cat ~/.gitconfig

发现是多了这两项配置 [http] proxy = socks5://127.0.0.1:1080 [https] proxy = socks5://127.0.0.1:1080 

git取消socks代理

git config --global --unset http.proxy git config --global --unset https.proxy 
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/200514.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月20日 上午10:40
下一篇 2026年3月20日 上午10:41


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号