公司A电脑可以通过代理上网,B电脑无法连接代理服务器,但可以连接到A,因此考虑使用squid在A电脑上搭建二级代理,以达到B电脑可以访问internet的目的。
以下引自squid-cache wiki:http://wiki.squid-cache.org/Features/CacheHierarchy?highlight=%28%5CbCategoryFeature%5Cb%29%7C%28faqlisted.yes%29
How do I configure Squid forward all requests to another proxy?
First, you need to give Squid a parent cache with the ***cache_peer *** directive. Second, you need to tell Squid it can not connect directly to origin servers with never_direct. This is done with these configuration file lines:
cache_peer parentcache.foo.com parent 3128 0 no-query default
never_direct allow all
比如,原代理服务器地址是192.168.1.5,端口是8080,那么应该在squid的配置文件squid.conf中增加以下内容:
cache_peer 192.168.1.5 parent 8080 0 default
never_direct allow all
如果原代理服务器需要用户名密码,