我可以将文件上传到使用curl就好了我的Apache Web服务器:
echo "[$(date)] file contents." | curl -T - http://WEB-SERVER/upload/sample.put
但是,如果我把一个Squid代理服务器之间的话,我不能够:
echo "[$(date)] file contents." | curl -x http://SQUID-PROXY:3128 -T - http://WEB-SERVER/upload/sample.put
卷曲报告以下错误:
注意:此错误响应是HTML格式的,但我已经删除为了便于阅读的标签。
ERROR: The requested URL could not be retrieved
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL:
http://WEB-SERVER/upload/sample.put
The following error was encountered:
Unsupported Request Method and Protocol
Squid does not support all request methods for all access protocols.
For example, you can not POST a Gopher request.
Your cache administrator is root.
我squid.conf
似乎没有被任何具有ACL /规则,应该会禁止基础上, src
或dst
IP地址或protocol
,或HTTP method
...... 我可以做一个HTTP POST
一样的精细之间客户端和Web服务器,使用相同的代理之间坐在英寸
在失败的情况下, HTTP PUT
情况下,一看就知道是实际发生的请求和响应流量,我把一个netcat
过程中卷曲和Squid之间,这是我所看到的:
请求:
PUT http://WEB-SERVER/upload/sample.put HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: WEB-SERVER
Pragma: no-cache
Accept: */*
Proxy-Connection: Keep-Alive
Transfer-Encoding: chunked
Expect: 100-continue
响应:
HTTP/1.0 501 Not Implemented
Server: squid/2.6.STABLE21
Date: Sun, 13 May 2012 02:11:39 GMT
Content-Type: text/html
Content-Length: 1078
Expires: Sun, 13 May 2012 02:11:39 GMT
X-Squid-Error: ERR_UNSUP_REQ 0
X-Cache: MISS from SQUID-PROXY-FQDN
X-Cache-Lookup: NONE from SQUID-PROXY-FQDN:3128
Via: 1.0 SQUID-PROXY-FQDN:3128 (squid/2.6.STABLE21)
Proxy-Connection: close
<SNIPPED the HTML error response already shown earlier above>
注:我已经匿名的IP地址和服务器名称在整个可读性原因。