小编Fad*_*enB的帖子

使用 curl 通过代理 (polipo) 访问受基本身份验证保护的网站

我正在尝试下载通过基本身份验证保护的文件:

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 …

authentication proxy curl polipo

6
推荐指数
2
解决办法
8万
查看次数

标签 统计

authentication ×1

curl ×1

polipo ×1

proxy ×1