linux 代理
临时代理 重启失效
export http_proxy=127.0.0.1:1080
export https_proxy=127.0.0.1:1080
永久代理
在 /etc/profile (全局)、 ~/.bashrc (用户)
export proxy="http://127.0.0.1:1080"
export http_proxy=$proxy
export https_proxy=$proxy
export ftp_proxy=$proxy
export no_proxy="localhost, 127.0.0.1, ::1"
取消代理
unset http_proxy
unset https_proxy
unset ftp_proxy
unset no_proxy
yum 代理
/etc/yum.conf
proxy=http://127.0.0.1:1080/
wget 代理 默认是走 linux 系统代理
export http_proxy=127.0.0.1:1080
export https_proxy=127.0.0.1:1080
或者 执行命令时候 使用 -e 指定 代理
-e "http_proxy=http://127.0.0.1:1080"
docker 代理
需要在 /etc/systemd/system/docker.service.d/https-proxy.conf 中配置
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:1080/" "HTTPS_PROXY=https://127.0.0.1:1080/" "NO_PROXY=localhost,127.0.0.1,docker-registry.example.com"
python 代理
easy_install 使用的是系统代理 例如 linux代理
export http_proxy=127.0.0.1:1080
export https_proxy=127.0.0.1:1080
取消代理
unset http_proxy
unset https_proxy
pip 使用代理 需要在命令中指定
pip install --proxy=http://127.0.0.1:1080 <模块名>
git
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
git config --global http.proxy http://127.0.0.1:1080
git config --global http.proxy https://127.0.0.1:1080
https
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
取消
git config --global --unset http.proxy
git config --global --unset https.proxy
npm
npm config set proxy http://127.0.0.1:1080
npm config set https-proxy http://127.0.0.1:1080
取消
npm config delete proxy
npm config delete https-proxy
查看
npm config list
yarn
yarn config set proxy http://127.0.0.1:1080
yarn config set https-proxy http://127.0.0.1:1080
取消
yarn config delete proxy
yarn config delete https-proxy
java 代理
-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=1080 -Dhttp.nonProxyHosts=10.10.10.10
-DsocksProxyHost=127.0.0.1-DsocksProxyPort=1081 -DsocksnoProxyHost=10.10.10.10
网友评论