3

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.

user586203
  • 39
  • 2
  • 4
    I think a better use of your time is to talk to you kids and make the understand why certain things on the internet aren't appropriate. Anything you wirte will be able to be worked around in 2 seconds, and the simple fact that it's blocked will make the kids more likely to look at this stuff. Heaven forbid your kids look at pornography. Maybe if they could do it and have it explained to them in context, we would have much more well adjusted kids. – Falmarri Jan 23 '11 at 08:54
  • Yes, that sounds reasonable. My 8 year old should be able to view pornography as long as I explain it to him "in context". You don't have children, do you @Falmarri? – Paul May 08 '11 at 18:20

1 Answers1

2

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.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • With proper administrative rules in place the kids wouldn't be allowed to change the proxy in the browser, so at least this would not be a problem. But as you said, just go with one of the solutions on the market instead of implementing this for yourself. Or at least take an open source Java HTTP proxy and add just the filtering capabilities, and the login page. – Daniel Jan 23 '11 at 09:06
  • Thanks all for your answers and comments. Daniel can you please be more specific on how to adjust the admistrative settings to restrict access to modify proxy settings please? – user586203 Jan 25 '11 at 05:58
  • The kids are probably gonna come here to find the workaround around the proxy. – Gurwinder Singh Dec 28 '16 at 03:15