免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1366 | 回复: 0
打印 上一主题 下一主题

tinyproxy的filter应用 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-22 15:24 |只看该作者 |倒序浏览

                想对代理的目标访问机器做一些限制,限制其只能够访问限定的主机。本来想修改tinyproxy的代码,一直找借口拖延,今天亮亮找我下载论文的时候,我想起这件事来。
拿出tinyproxy的代码,发现有个filter_init还有filter_url等函数,猜想tinyproxy已经有了filter功能了。
查看/etc/tinyproxy/tinyproxy.conf中:
#
# The location of the filter file.
#
#Filter "/etc/tinyproxy/filter"
#
# Filter based on URLs rather than domains.
#
#FilterURLs On
#
# Use POSIX Extended regular expressions rather than basic.
#
#FilterExtended On
#
# Use case sensitive regular expressions.
#                                                                        
#FilterCaseSensitive On     
#
# Change the default policy of the filtering system.  If this directive is
# commented out, or is set to "No" then the default policy is to allow
# everything which is not specifically denied by the filter file.
#
# However, by setting this directive to "Yes" the default policy becomes to
# deny everything which is _not_ specifically allowed by the filter file.
##FilterDefaultDeny Yes
我们可以直接设置filter来实现:只对限定站点的代理,其他的不代理。
我们修改配置文件为:
Filter "/etc/tinyproxy/filter"
FilterURLs On
FilterDefaultDeny Yes
这样tinyproxy只能够代理filter文件中指定的URL,我们在filter文件中添写上我们的目标代理主机就可以了:
hit.edu.cn
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12592/showart_572760.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP