1 of 1 people found this helpful
Unfortunately, Apache httpd doesn't support HTTP upgrade out of box. Here are some ideas to solve this:
- use http://httpd.apache.org/docs/trunk/mod/mod_proxy_wstunnel.html (recommended)
- bypass httpd completely, by exposing websockets on different port
- use https://code.google.com/p/pywebsocket/
- use other reverse proxy server that does support it (like nginx with nginx_tcp_proxy_module)
Thanks! Does mod_proxy_wstunnel play nicely with mod_cluster? By that I mean, do I need to specify each host in my cluster manually within my https.conf or is there a way to leverage the dynamic clustering functionality of mod_cluster?
I was able to install mod_proxy_wstunnel and get it configured within Apache 2.4. However, now when I request a connection to the web socket I get an HTTP 404. The same URL path works fine if I bypass Apache and go directly to Wildfly. Have you ever seen anything like this before? My Apache config looks like this:
# This is mod_cluster module configuration file. Please refer to
# mod_cluster README for more information on how to enable mod_cluster.
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so
LoadModule manager_module modules/mod_manager.so
Allow from all
Allow from all
ProxyPass /WebSocketTest/hello/ ws://localhost:9080/WebSocketTest/hello/
ProxyPass / balancer://myBalancer/
I'm able to access other resources within this WAR via Apache with no problem whatsoever. The underlying HTML page loads just fine. Everything's good. The 404 comes when I try and access the web socket path, though. Thoughts?
Does mod_proxy_wstunnel play nicely with mod_cluster?
I don't think anyone has tested this configuration (so thank you for doing this!), it looks like your configuration is correct but mod_proxy_wstunnel seem to require service of the mod_proxy directly.
You will probably need to set it up yourself outside of mod_cluster.
@ Akhbar Falafel,
Did you get the solution working in your cluster?
@ Radoslav Husar,
use http://httpd.apache.org/docs/trunk/mod/mod_proxy_wstunnel.html (recommended)'
Can you please provide some more details on the this option ? '
Does it mean I can use mod_proxy_wstunnel in my mod_cluster configuration ?
Thanks in advance.
I tried to set up the websocket in a clustered project using Wildfy 10, HTTPD 2.4.25 and cluster 1.3.9 but it does not work.
Can you please give more details on the use of the "mod_proxy_wstunnel" in such context?
Thank you in advance.