I am trying to download a file protected via basic auth:

curl "http://User:Pass@example.com/blub/bla.bin"

This is working fine.

As soon as I tell curl to use my locally installed polipo it fails:

$ http_proxy="" curl "http://XXXXX:Pass@example.com/blub/bla.bin"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<title>Proxy error: 504 Host XXXXX lookup failed: Host not found.</title>
<h1>504 Host XXXXX lookup failed: Host not found</h1>
<p>The following error occurred while trying to access <strong>http://XXXXX:Pass@example.com/blub/bla.bin</strong>:<br><br>
<strong>504 Host XXXXX lookup failed: Host not found</strong></p>
<hr>Generated Wed, 12 Mar 2014 22:46:10 CET by Polipo on <em>hostname:8123</em>.

Is this caused due to an error in Polipo or curl? (Or am I doing it wrong?)

EDIT: http_proxy="" curl -u XXXXX:Pass "http://example.com/blub/bla.bin" is working fine. Thanks!

2 Answers 2


Not necessary to use http_proxy, try this:


curl -x -U XXXXX:Pass "http://example.com/blub/bla.bin"


Found the anwser myself after some more digging:

http://curl.haxx.se/docs/manual.html states

NOTE! According to the URL specification, HTTP URLs can not contain a user and password, so that style will not work when using curl via a proxy, even though curl allows it at other times. When using a proxy, you must use the -u style for user and password.

So I was doing it the wrong way :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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