-
1. Re: Wildfly 8.1 - Websockets in a Clustered Config?
rhusar Jul 29, 2014 10:12 AM (in response to sdnakhla)1 of 1 people found this helpfulUnfortunately, 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)
-
2. Re: Wildfly 8.1 - Websockets in a Clustered Config?
sdnakhla Jul 29, 2014 11:00 AM (in response to rhusar)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?
-
3. Re: Wildfly 8.1 - Websockets in a Clustered Config?
sdnakhla Jul 30, 2014 1:58 PM (in response to sdnakhla)@Radoslav --
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
#
MemManagerFile /var/cache/httpd
#
<VirtualHost *:80>
<Directory />
Order deny,allow
Allow from all
</Directory>
KeepAliveTimeout 60
MaxKeepAliveRequests 0
ManagerBalancerName myBalancer
ServerAdvertise On
AdvertiseFrequency 3
EnableMCPMReceive
<Location /mod_cluster-manager>
SetHandler mod_cluster-manager
Order deny,allow
Allow from all
</Location>
</VirtualHost>
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?
-
4. Re: Re: Wildfly 8.1 - Websockets in a Clustered Config?
rhusar Jul 31, 2014 8:19 AM (in response to sdnakhla)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.
-
5. Re: Wildfly 8.1 - Websockets in a Clustered Config?
samjose Feb 5, 2015 12:09 AM (in response to rhusar)@ 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.
-
6. Re: Wildfly 8.1 - Websockets in a Clustered Config?
samssat Mar 13, 2017 6:48 AM (in response to samjose)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.