我正在尝试下载通过基本身份验证保护的文件:
curl "http://User:Pass@example.com/blub/bla.bin"
Run Code Online (Sandbox Code Playgroud)
这工作正常。
一旦我告诉 curl 使用我本地安装的 polipo 它就会失败:
$ http_proxy="http://127.0.0.1:8123" 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">
<html><head>
<title>Proxy error: 504 Host XXXXX lookup failed: Host not found.</title>
</head><body>
<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>.
</body></html>
$
Run Code Online (Sandbox Code Playgroud)
这是由于 Polipo 或 curl 中的错误引起的吗?(还是我做错了?)
编辑:http_proxy="http://127.0.0.1:8123" curl -u …