users@glassfish.java.net

Re: mod_proxy blocking my Comet HTTP streaming response

From: Xu Erdong <xuerdong_at_gmail.com>
Date: Fri, 23 May 2008 18:32:44 +0800

Hi,
  This problem has gone after I upgrade the Apche Httpd to latest version
2.2.8, and I changed my mod_proxy configuration :
    ProxyPass /comet/ http://localhost:8080/comet/
    ProxyPassReverse /comet/ http://localhost:8080/comet/
  that is very simple. And I add a HTTP header in CometServlet:
    response.addHeader("Transfer-Encoding", "Chunked");
  Now the Apache proxy can fully write through the packets to client, no
blocking and latency.
  Hopes it can be helpful to others.

2008/5/23 Xu Erdong <xuerdong_at_gmail.com>:

> Hi,
>
> Because mod_jk doesn't support Comet in Glassfish v2 ur2, I tried
> mod_proxy instead of mod_jk to put Apache Httpd front of Glassfish for load
> balancing. In normal http request/response, it works well. But in Comet HTTP
> streaming, I found mod_proxy blocked the response until server close the
> stream (after timeout), then send the whole response to client at once.
> That's not my need, I need hold a long HTTP connection between client and
> server, and client will receive messages all the time from server.
> My mod_proxy configuration in httpd.conf is:
>
> ProxyPreserveHost on
> RewriteEngine on
>
> RewriteRule ^/comet$ /comet/ [R,L]
> RewriteRule ^/comet/(.*) http://localhost:8080/comet/$1 [P,L]
>
> that followed the instruction in
> http://www.manorrock.com/documents/glassfish/proxy.html, and my test
> environment is RHEL 5.1, Apache Httpd 2.2.3, Glassfish v2 ur2.
> If anyone resolved this problem, please tell me the solution.
> Thanks!
>
> --
> Best regards,
> Xu mailto:xuerdong_at_gmail.com




-- 
Best regards,
Xu mailto:xuerdong_at_gmail.com