LanX has asked for the wisdom of the Perl Monks concerning the following question:

Hi

after some googling I'm not sure about the best way to go, I need a proxy which limits the access to certain URLs.

Either completely blocked or only in a fixed time window or for a maximum number of minutes per day.¹

I had a look at HTTP::Proxy and HTTP::Daemon but couldn't find an example code for time based blocking. I want to go for the easiest approach.

Cheers Rolf

1) my nephew has a little i-net problem... :)
  • Comment on local proxy for time based URL blocking

Replies are listed 'Best First'.
Re: local proxy for time based URL blocking
by roboticus (Chancellor) on Nov 17, 2010 at 02:46 UTC

    LanX:

    Squid may be just the thing for you. It's already written, so just configure it and have at it.

    ...roboticus

      Thanx a lot!

      But maybe a little oversized for my needs.

      And I couldn't find an option to limit the minutes spent on a website with those ACL templates.

      Cheers Rolf

Re: local proxy for time based URL blocking
by aquarium (Curate) on Nov 17, 2010 at 03:08 UTC
    the joy of parenting in a world of 24x7 on internet. they could quickly get around this proxy by retrieving the content via another proxy. there are plenty of those on the internet, quite happy to forward entire websites. they could also get another web browser or just change/remove current proxy setting. there's no way to specify a proxy system wide, it's set at application level. also whilst i've setup several squids myself without too much hassle, depending on your confidence and time available to read the details, you may want to avoid that.
    what i think you actually want is some good parental controls software that is not visible to the user. there's plenty of that around, and they do have time based url restrictions and various other flexibilities. they hook into the tcp/ip stack, so all traffic is checked against specified rules. a special key sequence and assigned admin password brings up the gui to manage it. they also optionally log all traffic, so you can tighten the rules if needed.
    but even these can be thwarted by an enterprising youngster, once they find out they're being watched & ruled 24x7 on internet by parents. hence the only real way is to properly monitor usage as a parent (physical visits to computer room) and early education about time management and the various dangers on the net. being careful not to be too negative/confrontational is key to such dialogue with kids.
    the hardest line to type correctly is: stty erase ^H
      Thx, but I think my nephew just needs a little help to dose the time he spends...

      He's a little addicted to some websites and where he just wants to spent 15-30 min per day and looses control. (Hei I can perfectly understand his problem ;)

      I certainly don't plan to reinvent stalinistic control and can't really interfere into the way he is educated. =)

      Cheers Rolf

        if he can self-administer the help...then all he needs is a clock (a real physical one) placed next to pc, works well....except in situations like playing enemy territory or whatever latest thing, or waiting for closure in conversations on facebook. i've had the problem of wasting time on enemy territory. the only cure being losing interest in spending time that way. as game/application success is now often measured in addictiveness..they're developed to be addictive in the first place. in other words, another "evil" one has to fend off. introducing other interesting things to do (takes various amounts of time, money, and energy) does help to diversify their interests.
        i've taken up inline skating with my kid, spent vast amounts of money on nice arts supplies/books/software etc. i think your nephew deserves (early christmas prezzie?) one of those consumer grade stylus tablets..as a mouse is horrible for any digital art.
        the hardest line to type correctly is: stty erase ^H