Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to get header response of a URL by using proxy username, password, host and port? is there any Linux command to get the same response?

share|improve this question

Something like the following should give you what you want....

export http_proxy=""  

wget -q --server-response -O /dev/null  --proxy-user=USER  \

(if I have understood the question correctly) Its likely possible to produce some similar result with either curl or perl with LWP module, if you are on a distro with no wget...)

share|improve this answer

The curl version of Tom H's answer is:

curl -I -U user:password -x

Both curl and wget will also honour environment variables with the username and password such as:

export http_proxy=""

Feel free to wrap the password in quotes if it contains characters that bash will interpret such as !, *, \, <, >, |, ~ or several others.

Note that using the password on the command line like that will cause it to end up in your bash history and usually be available in a process listing while the command is running. There doesn't seem to be an option to read the password from a file but putting the whole command in a bash script will at least keep the password out of your bash history. Putting the environment variable in your ~/.bash_profile would seem to be the best method.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.