创建自定义代理服务器应用程序
我的一个朋友问我这个问题,我对此不太了解。
因此,我在这里问您:
一个像代理服务器一样工作的自定义应用程序(不是它的完整版本),即该应用程序允许您指定网络用户可以在其客户端浏览器中访问的一些网站。
我有一些想法,这个功能内置在代理服务器中,我们可以使用 Apache 作为代理服务器,但我不知道该怎么做。
我可以用 Java、Ruby 或 .NET 开发这样的应用程序吗?因为这将允许我使用数据库来维护允许和阻止的网站列表 + 我可以提供更简单的 UI 来添加或修改数据。
帮帮我吧,我很困惑。
A friend of mine asked me this, and I had not much of an idea about it.
So, here I am asking you:
A custom application that works like a proxy server(not the complete version of it), i.e The app allows you to specify some websites that the users of the network can visit in their client browsers.
I have some idea, that this functionality is inbuilt in a proxy server and we can use Apache as a proxy server, but I don't know how to do it.
Can I develop such an application in Java, Ruby, or .NET, coz that will allow me to use a database to maintain the list of allowed and blocked websites + I can provide an easier UI to add or modify data.
Help me, I am quite confused.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任何代理服务器都具有此功能。例如使用squid,您可以将其设置为默认拒绝任何请求并仅允许特定站点。但是,如果这是唯一的目标,您可能需要考虑拒绝对端口 80 的请求,而只允许防火墙中的特定 IP 范围。
但这两种选择都有效。防火墙选项速度更快,浏览器无法绕过,但动态性较低(DNS 解析仅在规则启动/重新加载时发生),并且如果一个 IP 托管多个站点,则可能允许比预期更多的站点。
您可能应该问您的朋友他/她的非技术目标是什么。就像“我不想让我的女儿浏览色情内容”而不是“我需要一个阻止网站的应用程序”。
Any proxy server has this functionality. For example using squid, you can set it to default deny any requests and only allow specific sites. However if that's the only goal, you may want to consider denying requests to port 80 and only allow specific IP ranges in your firewall instead.
Both options work though. The firewall option is faster and cannot be bypassed by the browser, but is less dynamic (DNS resolving only happens on rule start/reload) and may allow more sites then intended if one IP hosts more then one site.
You should probably ask your friend what his/her non-technical goals are. Like "I don't want my daughter to surf porn" rather then "I need an app that blocks sites".