{{tag>Brouillon Réseau Web}}
= Config client web proxy
== Générique
Les variables ''http_proxy'' devrait toujours être en minuscule.
Idem pour toutes les variables ayant pour préfixe ''http_''
Préférer ''ALL_PROXY'' en majuscule
Source : https://everything.curl.dev/usingcurl/proxies/env.html
Proxy HTTP
#export http_proxy=http://192.168.56.1:3128
#export https_proxy=http://192.168.56.1:3128
export ALL_PROXY=http://192.168.56.1:3128
export NO_PROXY=localhost,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16,::1
Proxy Socks
#export ALL_PROXY=socks://127.0.0.1:1080/
export ALL_PROXY=socks5h://127.0.0.1:1080
export NO_PROXY=localhost,127.0.0.0/8,::1
Config permanent / persistent
''/etc/environment''
#http_proxy=http://192.168.56.1:3128
#https_proxy=http://192.168.56.1:3128
ALL_PROXY=http://192.168.56.1:3128
NO_PROXY=localhost,127.0.0.1,localaddress,.localdomain.com,192.168.56.12
Autre
export use_proxy = on
Curl
curl -x '' https://gnu.org
=== Mot de passe
Pour un proxy avec authentification
export ALL_PROXY=http://Nom:MotDePasse@192.168.56.1:3128
Si caractères spéciaux ou accentué vous devez encoder les caractères. Voir : 'URL encoding / Percent encoding'
=== Sudo
Pour charger la conf de /etc/environment
sudo su
''-E''
-E, --preserve-env
Indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the user does not have permission to preserve the environment.
sudo -E -s
Ou
''/etc/sudoers''
Defaults env_reset
Defaults env_keep += "http_proxy"
Defaults env_keep += "https_proxy"
== RedHat
''/etc/yum.conf''
proxy=http://192.168.2.30:3128
== Debian
Voir [[Proxy et apt-get]]
== Docker
Voir [[Notes - Docker - proxy]]