www-modproxy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Re: [PATCH] Reverse Proxy HTTP Hooks
Date Wed, 16 May 2001 23:45:31 GMT
Ian Holsman wrote:

> the code puts 2 hooks into the http_proxy code.
> one before the actual proxy is called
> the other after the response is recieved.
> 
> the reason we need them:
> we plan on sending notes set in the subprocess_env table (via mod_include)
> to the app-server which meet a certain criteria (eg starting with CNET-) these
> would be changed to header_in with the format (X-CNET-) which the appserver will read
> and respond to.
> 
> there was some talk over here that the app-server will send us some response headers
> which will need to be parsed in later parts of the html file, so the 'post' hook would
> be responsible for putting them back in the subprocess_env notes table.
> 
> I can post the module which does this work too if you would like. It is similiar to what
> Kwindala did on 1.3.
> 
> I know I could rewrite this as a filter, but I don't know how to 'add' the filters to
the
> proxy request as the syntax is too limiting.

Hooks again are very proxy specific - I am trying really hard to get
away from proxy specific stuff. They spelled doom for the 1.3 proxy, and
things have vastly improved since things became more modular and more
simple.

In theory the existing Set(In|Out)putFilter directives should allow you
to do exactly what you need to do without any modification to the
existing proxy code at all. Write an input filter to handle the stuff
before the connection, and the output filter will handle stuff you need
after the connection. Make sure that whatever filter you use is
triggered only on certain URLs, this way you can ensure the filter only
runs when used as a subrequest from mod_include, and not otherwise.

Of course example code to start with is a huge help, and from my
experience with mod_headers there doesn't seem to be any at the moment.
Once I have finished with mod_headers though check there, as it is a
rather simple example of an input filter and an output filter (as soon
as I can get the &^%%#^% input filter to work).

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."
Mime
View raw message