简体   繁体   中英

WebSocket connection interrupted when Apache HTTPD in front of Tomcat

I try to use Tomcat implementation of WebSockets on local machine. When I use only tomcat everything works fine, but when I start use bundle Apache + mod_jk + Tomcat browser show me 'The connection to ws://example.com/test/echoMessage was interrupted while the page was loading' after couple of seconds of work. WebSocket connection is closed after this.

Can anyone tell me how to fix it?

I have: Apache HTTPD 2.2.18, mod_jk 1.2.37, Tomcat 7.0.28

Here is server side code that I use: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/ and client side: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/websocket/

Browsers: Firefox 12, Chrome 19

I would research whether Apache mod_proxy is able to transparently forward traffic at the TCP level at all. Since that is likely needed for WebSocket to pass through. IOW: is mod_proxy able to transparently reverse proxy WebSocket traffic?

But why would you want to bring Apache in the line anyway? It doesn't add any value, only more parts which can break. That is for WebSocket of course ..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM