Linux配置代理上网:修订间差异
外观
无编辑摘要 |
(没有差异)
|
2023年6月21日 (三) 17:14的最新版本
配置代理
无需验证
export http_proxy=http://proxy_ip:proxy_port
export https_proxy=http://proxy_ip:proxy_port
export SOCKS_SERVER=socks://proxy_ip:proxy_port
需要验证
export http_proxy=http://username:password@proxy_ip:proxy_port
export https_proxy=http://username:password@proxy_ip:proxy_port
export SOCKS_SERVER="socks://username:password@proxy_ip:proxy_port"
删除代理
unset http_proxy
unset https_proxy
unset SOCKS_SERVER
检查目前使用代理
echo $http_proxy
echo $https_proxy
echo $SOCKS_SERVER
验证代理通断
curl -x <proxy_ip:proxy_port> http://example.com
curl --socks5 <proxy_ip:proxy_port> http://example.com