Squid 问题 - 需要代理身份验证

问题描述 投票:0回答:1

我有一个使用代理(正向代理)到网站的网络请求,比如说 www.example.com 这个网站有反向代理(Squid),因此我的所有请求都作为 MISS 返回。 有没有办法使用转发代理并检索数据?

请理解我是这个领域的新手。

读了一段时间后,我设置了不兑现,这就是我得到的

这是请求

Command: GET
URI: http://www.example.com
ProtocolVersion: HTTP/1.1
UserAgent:  Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Referer:  http://www.example.com
Accept:  */*
Accept-Charset:  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Encoding:  gzip,deflate
Accept-Language:  en-us,en;q=0.5
Keep-Alive:  115
X-Requested-With:  XMLHttpRequest
X-Prototype-Version:  1.7
Expires:  Sun, 19 Nov 1978 05:00:00 GMT
Host:  www.example.com
Cookie:  
  PHPSESSID: 249477191de6048739cd8690fabd6060
  UTG: A-3345389704b26912f6d5422.73487509-0a3a0a26a100a113a119a24a1a4a77a7a6a      
  addOtr: 7L4L2
  CLIENT_WIDTH: 1916
  MAIN_WIDTH: 1726

Cache-Control:  no-store,no-cache
Pragma:  no-cache
ProxyConnection:  Keep-Alive
HeaderEnd: CRLF

这是回复

ProtocolVersion: HTTP/1.0
StatusCode: 407, Proxy authentication required
Reason: Proxy Authentication Required
Server:  squid/3.0.STABLE19
Mime-Version:  1.0
Date:  Mon, 31 Jan 2011 19:04:44 GMT
ContentType:  text/html
ContentLength:  2986
X-Squid-Error:  ERR_CACHE_ACCESS_DENIED 0
ProxyAuthenticate: Basic realm="Anonymous proxy"
Authenticate:  Basic realm="Anonymous proxy"
X-Cache:  MISS from funky
X-Cache-Lookup:  NONE from funky:2448
Via:  1.0 funky (squid/3.0.STABLE19)
ProxyConnection:  close
HeaderEnd: CRLF 

提前致谢

web-services http proxy squid
1个回答
0
投票

您需要将到期时间设置为未来。

尝试更改您的 Expires、Cache-Control 和 Pragma,使其看起来像这样:

缓存控制:最大年龄=300 日期:2011 年 2 月 4 日星期五 04:52:58 GMT 到期时间:2011 年 2 月 4 日星期五 04:57:58 GMT ...

(删除 Pragma。您可以通过编辑 .htaccess 文件来完成此操作)

© www.soinside.com 2019 - 2024. All rights reserved.