本文及资源最后更新时间 2021-01-16 by sky995
国内机器跑分的时候,有些脚本下载不下来,这时候可以通过使用代理来下载
设置环境变量:
不带口令
代码:
- 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:password@proxy.server.address:port/
- https_proxy = http://username:password@proxy.server.address:port/
wget 不使用代理命令行参数:
代码:
- wget –no-proxy FILE_URL
使用 Dante Server 创建 Socks 服务器
代码:
- apt install –assume-yes –no-install-recommends dante-server
- cat << “EOF” > /etc/danted.conf
- logoutput: /var/log/socks.log
- internal: eth0 port = 1080
- external: eth0
- clientmethod: none
- socksmethod: none
- user.privileged: root
- user.notprivileged: nobody
- client pass {
- from: 0.0.0.0/0 to: 0.0.0.0/0
- log: error connect disconnect
- }
- client block {
- from: 0.0.0.0/0 to: 0.0.0.0/0
- log: connect error
- }
- socks pass {
- from: 0.0.0.0/0 to: 0.0.0.0/0
- log: error connect disconnect
- }
- socks block {
- from: 0.0.0.0/0 to: 0.0.0.0/0
- log: connect error
- }
- EOF
- systemctl restart danted
代码:
- curl -x socks5://dante_server_ip:1080 ifconfig.co