title: How to make the Apache reverse proxy server to support the long-polling connection?
body: <p>We have an Apache comet servlet on the Tomcat 8 server for the long-polling connection as below.</p>
  
  <pre><code>public class Connect extends HttpServlet implements CometProcessor {
      public void event(CometEvent event) throws IOException, ServletException {
          HttpServletRequest request = event.getHttpServletRequest();
          HttpServletResponse response = event.getHttpServletResponse();
          if (event.getEventType() == CometEvent.EventType.BEGIN) {
              event.setTimeout(300000);
              ...
          } else if (event.getEventType() == CometEvent.EventType.ERROR) {
              event.close();
          } else if (event.getEventType() == CometEvent.EventType.END) {
              event.close();
          }
      }
  }
  </code></pre>
  
  <p>And the connector of the Tomcat8 server.xml as below</p>
  
  <pre><code> &lt;Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
                 connectionTimeout="90000"
                 redirectPort="8443" URIEncoding="UTF-8"/&gt;
  </code></pre>
  
  <p>The comet connection will be timeout after 300 seconds. This is worked when client is trying to connect to the Tomcat directly.(<a href="http://IP:8080/Connect" rel="nofollow noreferrer">http://IP:8080/Connect</a>).</p>
  
  <p>However, if we set up an Apache reverse proxy, the connection will always be timeout after 60 seconds. The Apache proxypass setting as below</p>
  
  <pre><code>ProxyTimeout 310
  ProxyPass /Connect http://localhost:8080/Connect connectiontimeout=60 timeout=310 keepalive=On ttl=350
  ProxyPassReverse /Connect http://localhost:8080/Connect
  </code></pre>
  
  <p>How can we make the long-polling connection works on the reverse proxy?</p>
  
  <p>Thanks</p>