wget/curl 命令使用代理

网络资源 admin 来源:原文链接 2年前 (2022-07-05) 730次浏览 0个评论

国内机器跑分的时候,有些脚本下载不下来,这时候可以通过使用代理来下载

设置环境变量:

不带口令

export http_proxy=http://your-ip-address:port
export https_proxy=https://your-ip-address:port

带口令

export http_proxy=http://user:password@your-proxy-ip-address:port
export https_proxy=https://user:password@your-proxy-ip-address:port

取消代理

unset http_proxy
unset https_proxy

curl 使用命令行参数:[]内可选部分

protocol: http https socks5

curl -x '<[protocol://][user:password@]proxyhost[:port]>' url

wget 使用命令行参数:

wget --proxy=on --proxy-user "username" --proxy-password "password" url

wget 使用~/.wgetrc 优先级高于环境变量:

use_proxy = on
proxy_user=username
proxy_password=password
http_proxy = http://proxy.server.address:port/
https_proxy = http://proxy.server.address:port/

或者

use_proxy = on
http_proxy = http://username:[email protected]:port/
https_proxy = http://username:[email protected]:port/

wget 不使用代理命令行参数:

wget --no-proxy FILE_URL

VPS小白 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:wget/curl 命令使用代理
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址