cmdref.net - Command Reference

This site is command references for system engineers.

User Tools

Site Tools


Top     OS ( Linux )     Middleware     Protocol     Hardware     Programming ( Shell Script )     SiteMap

Sidebar

Top     SiteMap








Reference











.

middleware:proxy:how-to-use-proxy.html



How to use proxy in Linux

yum

Temporary Setting

export http_proxy=http://proxy.hostname.com:9999/
export http_proxy=http://192.168.0.10:9999/


Continuous Setting

/etc/yum.conf

[main]
proxy=http://192.168.0.10:9999/
[main]
proxy=http://xx.xx.xx.xx:8080
proxy_username=username
proxy_password=password




curl

Temporary Setting

# curl --proxy http://proxy.example.com:8080 http://example.com/
# curl -U user01:password01 --proxy http://proxy.example.com:8080 http://example.com/
NTLM
# curl -I --ntlm --user example.local\user01:password https://example.com/
# curl -u 'example.local\user01':password  --ntlm  https://example.com/


Continuous setting

/etc/curlrc

#proxy-user = "user:password"
proxy = "http://proxy.example.com:8080"




wget

Temporary Setting

export http_proxy=http://192.168.0.10:9999/
export https_proxy=http://192.168.0.10:9999/
wget http://www.yahoo.co.jp
export http_proxy="http://username:password@proxy.example.com:8080/"
export ftp_proxy="http://username:password@proxy.example.com:8080/"
wget -e http_proxy=xx.xx.xx.xx:8080 http://example.com/ 

wget -e https_proxy=xx.xx.xx.xx:8080 https://example.com/ 


Continuous setting

$HOME/.wgetrc

sample1
http_proxy=http://192.168.0.10:9999/
https_proxy=http://192.168.0.10:9999/
sample2
use_proxy = on
proxy_user = test-user
proxy_passwd = password
http_proxy = http://192.168.0.5:8080
https_proxy = http://192.168.0.5:8080
ftp_proxy = http://192.168.0.5:8080




svn

Continuous setting

~/.subversion/servers

[global]
http-proxy-host = 192.168.0.10
http-proxy-port = 8080




git

Temporary Setting

$ export http_proxy=http://xx.xx.xx.xx:8080
$ export https_proxy=$http_proxy


Continuous setting

# git config --global http.proxy http://xx.xx.xx.xx:8080
# git config --global https.proxy http://xx.xx.xx.xx:8080

# cat ~/.gitconfig
[http]
    proxy=http://192.168.0.10:8080
[https]
    proxy=http://192.168.0.10:8080




perl CPAN

Continuous setting

# perl -MCPAN -e shell

cpan> o conf http_proxy    <- check
cpan> o conf ftp_proxy     <- check

cpan> o conf http_proxy http://xx.xx.xx.xx:9999
cpan> o conf ftp_proxy http://xx.xx.xx.xx:9999

cpan> o conf http_proxy    <- check
cpan> o conf ftp_proxy     <- check

cpan> o conf commit



middleware/proxy/how-to-use-proxy.html.txt ยท Last modified: 2017/05/26 by admin