cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

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



How to use proxy in Linux

was cli

export http_proxy=http://192.168.x.x:xxxx/
export https_proxy=http://192.168.x.x:xxxx/

export no_proxy=127.0.0.1,localhost,192.168.2.0/24
export no_proxy = mybucket.s3-us-west-2.amazonaws.com,169.254.169.254

169.254.169.254 is Address of the server to which the metadata will be returned


yum

Temporary Setting

export http_proxy=http://192.168.x.x:xxxx/
export https_proxy=http://192.168.x.x:xxxx/

export no_proxy=127.0.0.1,localhost,192.168.2.0/24


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


Note

# yum --disablerepo=* --enablerepo=remi,epel search httpd


rpm

Temporary Setting

rpm --httpproxy http://proxy.example.com --httpport 8080 -ivh http://xxxxxxx/xxxx.rpm




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/
export no_proxy=127.0.0.1,localhost,192.168.2.0/24

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: 2024/01/10 by admin

Page Tools