6 Replies Latest reply on Mar 13, 2017 6:48 AM by samssat

    Wildfly 8.1 - Websockets in a Clustered Config?

    sdnakhla

      I have a 2-node cluster setup using the standalone-full-ha.xml configuration on Wildfly 8.1.  I'm trying to open up a web socket connection through Apache HTTPD URL, but when I do I see the following error in my logs, and the web socket open fails with an error in JavaScript:

       

      2014-07-28 15:58:52,675 ERROR [io.undertow.request] (default task-4) UT005023: Exception handling request to /WebSocketTest/hello: java.lang.IllegalStateException: UT000077: The underlying transport does not support HTTP upgrade

       

      Is there any way to get such a configuration working in a clustered setup?  Or would I need to go to the specific app server port directly and bypass Apache HTTPD?

        • 1. Re: Wildfly 8.1 - Websockets in a Clustered Config?
          rhusar

          Unfortunately, Apache httpd doesn't support HTTP upgrade out of box. Here are some ideas to solve this:

           

          1 of 1 people found this helpful
          • 2. Re: Wildfly 8.1 - Websockets in a Clustered Config?
            sdnakhla

            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

              @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
                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

                  @ 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

                    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.