使用java实现网站家长控制
我想用java编写一个独立的应用程序来控制对受限网站的访问,而孩子们在父母不在身边时使用互联网。主要思想是根据浏览者来阻止成人/不需要的网站。用例如下:
1.用户打开浏览器。 2.我们的应用程序(在后台运行)应该弹出一个身份验证框并要求用户输入密码。 3.根据输入的密码,应用程序将识别用户是成人还是儿童。 4.如果是成人,网站将不受限制。 5.如果是孩子,那么一定会发生以下事情, (a) 浏览器请求的所有 URL 必须记录在日志文件中。 (b) 必须阻止打开成人/不需要的网站,并且必须在浏览器中显示警告页面。
我的问题是:这个应用程序可以用java实现吗?如果是的话怎么办?我如何监控响应并根据我的条件过滤它们?我认为通过使用java中的套接字编程可能是可能的。
感谢任何形式的帮助。
I want to code a standalone app in java to control access to restricted websites while kids use internet when parents are not around. The main idea is to block the adult/unwanted websites based on the person who is browsing. The use-case goes like this:
1.The user opens a browser.
2.Our app (which is running in the background) should pop up an authentication box and ask the user to enter a password.
3.Based on the password entered, the app would identify the user as an adult or a kid.
4.If adult, there will be no restriction on websites.
5.If kid, then the following things must happen,
(a)All the requested URLs from the browser must be logged in a log file.
(b)Adult/unwanted websites must be blocked from opening and a warning page must be displayed in the browser.
My question is: can this app be implemented in java? If yes how? How can i monitor the responses and filter them based my conditions? I thought it might be possible by using socket programming in java.
Help of any kind is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,您可以用 Java 编写一个 HTTP 代理,这可能会正常工作......直到您的孩子长大到能够弄清楚如何更改浏览器中的代理为止。
当然,您必须确定什么才算是“成人/不需要的网站”,这在历史上被证明是很棘手的……白名单可能是最简单的方法。
听到这样的事情已经存在,我不会感到惊讶。自己编写一个强大的 HTTP 代理(包括流媒体等)可能很棘手。远非不可能,但可能不是很好地利用你的时间,除非你想为了教育价值而这样做。
Well, you could write an HTTP proxy in Java, and that would probably work okay... until your kids are old enough to figure out how to change the proxy in their browser.
Of course, you'd have to determine what counts as an "adult/unwanted website" which has historically proven tricky... a whitelist may be the easiest approach here.
I wouldn't be surprised to hear that such things already exist. Writing a robust HTTP proxy yourself (including streaming etc) could be tricky. Far from impossible, but probably not a good use of your time unless you wanted to do it for the educational value.