httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chen Chien-Yu <honer...@gmail.com>
Subject Re: interaction between mod_substitute and mod_proxy
Date Mon, 14 Jun 2010 14:01:09 GMT
Hi Eric,

Yes, you're right. The behavior I said is within the mod_proxy_connect.
I'm a little confused by the proxy modules, such as mod_proxy,
mod_proxy_connect, mod_proxy_http...

Actually, what I want to achieve is to modify the html content (body) which
is sent from the server via reverse proxy to the client.

                               Reverse Proxy
  Web server <-----------> Apache <-----------> Client
1.<-------------------------------|          | <------------ Request
2.Response ----------> Modify content ------->


Seems that, the function ap_proxy_http_process_response in mod_proxy_http is
the appropriate place to add my code?
So I tried to print out the content of the bucket before this function pass
the brigade to the output filters...
But the contents aren't what I expect, instead it looks like this

<?xml version="1.0" encoding="iso-8859-1"?>\n<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"\n         "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n <head>\n
 <title>404 - Not Found</title>\n </head>\n <body>\n  <h1>404
- Not
Found</h1>\n </body>\n</html>\n

The actual content renders by the browser is alright and totally different
from that above.
If my memory serves right, what I see the content of brigades in the
mod_substittute is something like 404 - Not found which is similar to that I
mentioned.

Anything wrong with my concept?

Thanks

Best regards,
honercek

http://www.google.com/profiles/honercek


On Mon, Jun 14, 2010 at 8:29 PM, Eric Covener <covener@gmail.com> wrote:

> On Mon, Jun 14, 2010 at 7:42 AM, Chen Chien-Yu <honercek@gmail.com> wrote:
> > After roughly tracing the code of mod_proxy, it receives the data from
> the
> > server and sends out the contents to the client directly
> > via apr_socket_send().
> > Does that imply it doesn't put the data into output filters? That's why
> they
> > don't work together?
>
> Which proxy module specifically?  I can't imagine anything but
> mod_proxy_connect would do that.
>
> --
> Eric Covener
> covener@gmail.com
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message