Re: intercepting streams

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 22 Jul 2008 03:52:44 +1200

Michael Kaplan wrote:
> Yes sort of like a proxy error page, but specific to my application
> needs. This is a custom solution, so I need not worry about any history
> of complaints. I'm looking for something specific in the header, if it
> exists, I would send a custom reply HTML message to the user. I was
> examining the function parseHttpRequestAbort as this is similar to what
> I want to do, but with my own custom message.

Okay, it does sound exactly like what squid does to gnerate error
messages. Just on new criteria.

The interface to generate those is the error pages can mostly be found
in src/errorpage.*. With the ERR_X_X definitions in enums.h.

Adding an ERR_X_X definition, and a matching page template in the errors
directory should do half of it. The rest is detecting the error and
generating or replacing the response.

Amos

>
> Mike
>
>
>
> Amos Jeffries wrote:
>> Michael Kaplan wrote:
>>> Is there a mechanism within Squid that will allow me to send a
>>> message back to the host, almost like a redirect. For example, if I
>>> spot some misuse of the http header, I'd like to send an html reply
>>> to the host appearing in the browser saying something to the effect
>>> of , 'this header contained the following erroneous data: blah'
>>>
>>> Mike
>>
>> You mean like a proxy error page?
>>
>> Squid already does that for a lot of things that it knows about. The
>> problem is that web traffic can have a lot of different things, in a
>> lot of places and its often best to ignore header content that is known.
>>
>> For example, look back at the long history of complaints for squid
>> giving "Unknown Request Method". All because someone thought it would
>> be a good design to validate only the request methods in the HTTP RFC.
>>
>> Amos

-- 
Please use Squid 2.7.STABLE3 or 3.0.STABLE8
Received on Mon Jul 21 2008 - 15:52:45 MDT

This archive was generated by hypermail 2.2.0 : Mon Jul 21 2008 - 12:00:07 MDT