Hello! I have installed Apache 2.0 server as transparent proxy. I'am looking for solution which allow me to add some special and dynamic (from database) additional header information on my proxy and send request to destination server. Algorithm: 1. Client send a request from browser (in browser network option proxy is set) 2. My apache proxy recived request and processing them: - read an IP addres of remote user - read from database some information for example XXX - add to header information special object (x-my-walue = XXX) 3. Send this request to destination
Any idea, any tips? Please help me.
I assume that your destination is outside the same server (so a sub-request won't work).
It's probably the best to use mod_proxy to handle the proxying (3). And (2) can be done with a thin incoming connection filter. Of course you could use LWP to do the proxying (3), but it may add some overhead.
You can use Apache::Filter::HTTPHeadersFixup http://search.cpan.org/dist/Apache-Filter-HTTPHeadersFixup/ to make (2) really easy for you.
It has one problem that I don't have a solution for, yet. It's the KeepAlive connection, discussed in this thread:
http://marc.theaimsgroup.com/?t=107365172200005&r=1&w=2
I have some ideas on how to solve it.
To learn more about filters refer to:
http://perl.apache.org/docs/2.0/user/handlers/filters.html
But with Apache::Filter::HTTPHeadersFixup you don't really need to understand them ;)
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html