Re: Regarding an academic project work

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 31 Jan 2012 15:40:30 +1300

On 31.01.2012 08:58, Vishnu Narayanan M wrote:
> Sir,
>
> This is my second mail, I had introduced myself in the first mail. I
> am a final year graduate student. I am trying to implement a daily
> quota management in squid proxy. I have a program which will give me
> an integer return value; which I am using to decide if the quota for
> the particular user has expired or not.
>

Be aware Squid does not contain the mechanisms to do quotas accurately.
Due to ACLs and redirectors being run only at the beginning of a
transaction and loggers only being run at the ending there is a large
(possibly GB data large) gap in between where the client has essentially
free access.

> I have found out from internet that I can use 'Redirection Helpers'
> to
> setup the redirection functionality that i wanted. But it is not
> clear
> how to use it. It is said that "The helper program is NOT a standard
> part of the Squid package. However, some examples are provided below,
> and in the "helpers/url_rewrite/" directory of the source
> distribution". But it is not clear where to place the redirection
> file
> that I create,

Anywhere on the same machine. Squid only requires system permissions to
run it.

> and how to enable this feature in squid proxy.

With url_rewrite_program directive. Which takes the full path to your
script or binary helper. Along with any command line arguments it
requires.
http://www.squid-cache.org/Doc/config/url_rewrite_program/

> Also, it
> is not clear if this new file has to be named in some particular
> name.

It is optional. The helpers we package with Squid are named in a way
which makes it easy for admin to see where they are configured and what
they do. It is suggested to follow that naming style, but not required.

>
> I am planning to write a C++ program that will accept command line
> input and write new url to stdout in the format "[channel-ID]
> status:URL". Will this be enough for my purpose?

For a redirector, yes. But take care to avoid producing the
"status:URL" part when there is no change to be done to the URL.
http://wiki.squid-cache.org/Features/AddonHelpers#URL_manipulation

Amos
Received on Tue Jan 31 2012 - 02:40:36 MST

This archive was generated by hypermail 2.2.0 : Tue Jan 31 2012 - 12:00:13 MST