0

I have a chat-like application which uses Grizzly Comet in Glassfish and the HTTP streaming ("forever iframe") technique. It works when the browser is directly connected, but not if there is a reverse proxy in between them. It seems the reverse proxy is buffering the Javascript Comet event stream - if you open the proxied Comet event stream URL in Chrome, you can see that nothing is being received.

How can I disable this buffering?

Robin Green
  • 32,079
  • 16
  • 104
  • 187

1 Answers1

0

Instead of

response.setContentType("text/html");

do

response.getWriter().println("<!DOCTYPE html>");

before writing anything else to the response writer.

I don't think this is specified anywhere, but I'm basically relying on the dumbness of proxies compared to browsers.

Robin Green
  • 32,079
  • 16
  • 104
  • 187