vi /etc/profilegit
添加下面內容apache
http_proxy = http://username:password@yourproxy:8080 https_proxy=http://username:password@172.25.14.130:8080 ftp_proxy = http://username:password@yourproxy:8080 export http_proxy export ftp_proxy
vi /etc/yum.confnpm
添加下面內容vim
proxy=http://yourproxy:8080 proxy=ftp://yourproxy:8080 proxy_username=username proxy_password=password
vi /etc/wgetrcbash
添加下面內容maven
http_proxy=http://username:password@proxy_ip:port/ ftp_proxy=http://username:password@proxy_ip:port/
git config --global http.proxy http://username:password@172.25.14.130:8080 git config --global http.proxy https://username:password@172.25.14.130:8080
$ vim /usr/local/apache-maven-3.5.0/con/settings.xml 在proxys節點下添加 <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <username>proxyuser</username> <password>proxypass</password> <host>proxy.host.net</host> <port>80</port> <nonProxyHosts>local.net|some.host.com</nonProxyHosts> </proxy> id:代理的名稱(隨便設,XYZ也行) active:表示該代理是否激活 protocol:代理協議,這個不用改 username:當代理須要認證時的用戶名 password:當代理須要認證時的密碼 host:代理的IP地址 port:代理的端口號 nonProxyHost:指定不須要使用代理的主機,可不設置。若是有多個,用 | 分隔
Gradle代理設置gradle
$ cd ~/.gradle/ $ vim gradle.properties #建立gradle.properties文件,並添加一下內容: systemProp.http.proxyHost=172.25.14.13 systemProp.http.proxyPort=8080 systemProp.http.proxyUser=username systemProp.http.proxyPassword=password systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost systemProp.https.proxyHost=172.25.14.13 systemProp.https.proxyPort=8080 systemProp.https.proxyUser=username systemProp.https.proxyPassword=password systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
NPM代理設置spa
$ npm config set proxy http://username:password@server:port $ npm config set https-proxy http://username:pawword@server:port