各种应用使用代理的方法

  每次使用一个应用,就学习一种代理配置方法,慢慢的埋了不少的坑,更换代理又各种重新搜索,重新学习,这下搞个汇总:

  1. tomcat:bin/catalina.sh
    JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=ip -Dhttp.proxyPort=port -Dhttp.nonProxyHosts='localhost|appserver1|127.*|10.*|100.*'"
  2. maven:settings.xml
    <settings>
      <proxies>
        <proxy>
          <id>optional</id>
          <host>ip</host>
          <port>port</port>
          <nonProxyHosts>192.*.*.*</nonProxyHosts>
          <protocol>http</protocol>
          <active>true</active>
        </proxy>
      </proxies>
    </settings>
  3. jenkins:插件管理-高级-代理设置
  4. linux全局配置:/etc/profile、单个用户配置:~/.bashrc
    export http_proxy="http://user:pwd@proxyip:3128"
    export https_proxy="http://user:pwd@proxyip:3128"
  5. yum
    配置方式:/etc/yum.conf
    proxy=http://proxyip:3128
    proxy_username=username
    proxy_password=password
  6. rpm
    配置方式:~/.bash_profile
    export http_proxy=http://proxyip:3128/ 
    export ftp_proxy=http://proxyip:3128/ 
  7. wget
    配置方式: /etc/wgetrc
    http_proxy = http://proxyip:3128/
    ftp_proxy = http://proxyip:3128/
    命令方式:
  8. curl
    配置方式:~/.curlrc
    export http_proxy="http://user:pwd@proxyip:3128"
    export https_proxy="http://user:pwd@proxyip:3128"
    命令方式:
    curl -x "http://user:pwd@proxyip:3128" "http://destination"
  9. npm:~/.npmrc
    proxy=http://ip:3128/
    https-proxy=http://ip:3128/
    命令行:
    npm --proxy http://username:password@cacheaddress.com.br:80 install packagename
posted @ 2021-11-24 11:24  badwood  阅读(580)  评论(0编辑  收藏  举报
Badwood's Blog