【发布时间】:2012-11-13 14:33:51
【问题描述】:
我在代理下,如果我尝试curl http://localhost/mysite 或curl http://127.0.0.1/mysite curl 尝试使用代理解决它。所以我尝试了--noproxy 选项,但不起作用。代理为curl http://mysite.com 的外部服务器工作正常。
我的配置:
- Windows 8 下带有 curl 扩展的 Cygwin (bash)。
- 代理:
proxy.domain.xx:1080没有身份验证 http_proxy=http://proxy.domain.xx:1080- 本地服务器:XAMP 版本 1.8.0
- Apache 端口:80,443
- 浏览器:带代理的 Chrome,但配置为访问
localhost和*.dev
来自 curl --help
--noproxy : 逗号分隔的不使用代理的主机列表
我尝试了什么:
- 我已停用防火墙,但什么也没有
-
$ curl -v http://localhost/mysite-> 调试:回应
Connected to proxy.domain.xx (200.55.xxx.xx) port 1080 (#0) GET http://localhost/mysite HTTP/1.1 User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8r zlib/1.2.3 Host: localhost Accept: */* Proxy-Connection: Keep-Alive The system returned: <PRE><I>(111) Connection refused</I></PRE> -
curl -v --noproxy localhost, http://localhost/muestra回应
About to connect() to localhost port 80 (#0) * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 80 (#0) > GET /mysite HTTP/1.1 > User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8r zlib/1.2.3 > Host: localhost > Accept: */* > < HTTP/1.1 301 Moved Permanently < Server: Apache/2.4.2 (Win32) OpenSSL/1.0.1c PHP/5.4.4 < Location: http://localhost/mysite < Content-Length: 331 < Content-Type: text/html; charset=iso-8859-1
知道如何解决这个问题吗?
【问题讨论】:
-
你试过
export no_proxy=localhost吗? -
同样的事情...
301 Moved Permanently(--noproxy) 或(111) Connection refused(默认使用) -
我会说
--noproxy根据您的调试信息工作。301 Moved Permanently表示别的意思:en.wikipedia.org/wiki/HTTP_301