0%

linux中的常用的proxy 代理方式

原文 https://www.cnblogs.com/lovesKey/p/11979781.html

  1. 设置ALL_PROXY环境变量

    1
    export ALL_PROXY=socks5://127.0.0.1:1080

    支持socks5 http https
    取消

    1
    export ALL_PROXY=""
  2. 使用proxychains

    1
    github开源地址:https://github.com/rofl0r/proxychains-ng
  3. vpxN方式全局代理

  4. GO下载模块代理

    1
    2
    3
    4
    # Enable the go modules feature
    export GO111MODULE=on
    # Set the GOPROXY environment variable
    export GOPROXY=https://goproxy.io
  5. Git下的代理

    1
    2
    3
    4
    5
    6
    7
    8
    9
    #全局的
    git config --global http.proxy 'socks5://127.0.0.1:1080'
    git config --global https.proxy 'socks5://127.0.0.1:1080'

    #只对github.com
    git config --global http.https://github.com.proxy socks5://127.0.0.1:1080

    #取消代理
    git config --global --unset http.https://github.com.proxy
  6. wget或aria2c[HTTP方式]

    1
    2
    aria2c --http-proxy 'http://127.0.0.1:1087'
    wget -e http_proxy='http://127.0.0.1:1087'