Re: interaction between mod_substitute and mod_proxy

2010-06-14 Thread Chen Chien-Yu
Hi all,

It does work now...

Thanks

Best regards,
honercek

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


On Mon, Jun 14, 2010 at 10:01 PM, Chen Chien-Yu  wrote:

> 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
>
> \n "-//W3C//DTD XHTML 1.0 Transitional//EN"\n "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>\nhttp://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">\n \n
>  404 - Not Found\n \n \n  404 - Not
> Found\n \n\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  wrote:
>
>> On Mon, Jun 14, 2010 at 7:42 AM, Chen Chien-Yu 
>> 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
>> cove...@gmail.com
>>
>
>


Re: interaction between mod_substitute and mod_proxy

2010-06-14 Thread Chen Chien-Yu
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

\nhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>\nhttp://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">\n \n
 404 - Not Found\n \n \n  404 - Not
Found\n \n\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  wrote:

> On Mon, Jun 14, 2010 at 7:42 AM, Chen Chien-Yu  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
> cove...@gmail.com
>


Re: interaction between mod_substitute and mod_proxy

2010-06-14 Thread Eric Covener
On Mon, Jun 14, 2010 at 7:42 AM, Chen Chien-Yu  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
cove...@gmail.com


Re: interaction between mod_substitute and mod_proxy

2010-06-14 Thread Chen Chien-Yu
Hi all,

I'm a newbie to the development of Apache. It seems that the contents
returning from reverse proxy won't be processed by the mod_substitute?
I did some tests, in normal case without reverse proxy, the web pages from
the Apache itself will be substituted.

mod_proxy is implemented as a hook, but mod_substitute as a filter...
Is that possible to make them work together?

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?

If I wanna have the same effect as mod_substitute on mod_proxy, I should
modify the code of mod_proxy rather than using mod_substitute?

Thanks

Best regards,
honercek


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