> ## Content Index
> Fetch the complete content index at: https://www.bagz.fr/llms.txt
> Use this file to discover other available public pages before exploring further.

# Use wget/curl behind a proxy
- URL: https://www.bagz.fr/use-wgetcurl-behind-a-proxy/
- Published: 2017-03-05T21:14:42.000Z
- Updated: 2017-03-05T21:14:42.000Z
- Author: bgazui
- Tags: Linux, #Migrated-1790668826633, #wp, #wp-post, #Import 2026-09-29 08:00

If your machine is behind a proxy, you probably configured your browser for going through the proxy to reach Internet. But what about command line with **curl** and **wget**?

If you want to add the proxy temporarily for some few installations for example, just type (by replacing URL and port with yours):

export http\_proxy=http://MyProxyURL:3128  
export https\_proxy= http://MyProxyURL:3128  

If you want to make the changes globally and keep it after a restart (or a new login), you can:

- Add those lines in **\~/.wgetrc** to make it available only for **wget** and for the current userhttp\_proxy=http://MyProxyURL:3128  
https\_proxy=http://MyProxyURL:3128  
use\_proxy=on  
wait=15
- Add those lines in **/etc/environment** to make it work for either curl/wget or any http relevant command:http\_proxy=http://MyProxyURL:3128  
https\_proxy=http://MyProxyURL:3128

If you need authentication, you can simply include username and password in your connection string like:http\_proxy = http://username:password@MyProxyURL:3128