EAP 6.4 & WebSockets with web server
Hello, I already tried to ask about this here but since I haven't received any satisfactory response so far, I'm trying it here as well:
Based on:
- 16.2. Create a WebSocket Application
- Does JBoss EAP support the use of WebSockets?
- JBoss Enterprise Application Platform (EAP) 6 Supported Configurations - Red Hat Customer Portal
- Does Red Hat / JBoss offer support for Apache, mod_jk, mod_proxy, or mod_cluster? - Red Hat Customer Portal (by the way why does this one mention mod_proxy as supported when the Supported Configurations document above doesn't mention mod_proxy at all?)
- 4. Unsupported and Deprecated Features
- Add support of websocket proxying. · modcluster/mod_cluster@e801c55 · GitHub
- Make the websocket proxy switchable. · modcluster/mod_cluster@f1f68c5 · GitHub
It seems that:
- EAP 6.4 itself supports WebSockets
- supported web server connectors mod_cluster 1.2.11 / mod_jk 1.2.40 don't support WebSockets
- mod_cluster 1.3.1 supports WebSockets (without failover) via Apache HTTP Server 2.4.x mod_proxy_wstunnel but this configuration isn't supported by EAP 6.4
- Apache HTTP Server 2.4.x mod_proxy_wstunnel alone (well, typically combined with mod_proxy_http + mod_proxy_balancer) supports WebSockets but this configuration isn't supported by EAP 6.4
How is one supposed to achieve a supported configuration with web server and WebSockets?
Responses
Hi Petr
I did see your question on the community forums but I didn't get much more information to update you unfortunately at the time. What I've done is reached out to our engineers in this area who are discussing this with product management. We appreciate your research in to the supported configurations, at the moment it looks like you are right and this isn't supported.
Like I said, our product team will be in touch as soon as they have more information regarding your question and be able to provide much more information.
Thanks
Mustafa
Hello again,
I'd like to apologize for the lull in my responsiveness. I just wanted to drop by and make a statement as I've had conversations around this post in support cases with a few individuals.
JWS 3.x is not presently supported as a proxy to EAP. It may work, but we haven't tested it at this time and therefore can't support it's use. We are working on testing this and will be supporting JWS as a proxy to EAP in a later 3.x release. Please reply with any questions; I'd be happy to answer them, hopefully a bit quicker than this reply
-Coty
According to the latest update in https://access.redhat.com/articles/2026253, websocket is supported in the combination of mod_cluster 1.3.1.Final + EAP 6.4. Also, there's someone verified the function of loadbalancing WebSocket connection with modcluster: https://developer.jboss.org/thread/260794 (last comment of the thread)
Jason,
That article (https://access.redhat.com/articles/2026253) is for EAP 7 only.
For EAP 6 is this one: https://access.redhat.com/articles/111663
And it says that requires EAP 6.4.4 and above to use mod_cluster 1.3.1.Final or 1.3.5.Final. Although, that page is not like the EAP 7 one that says it works with WebSocket protocol.
Am I right?
Regards,
Arthur
Hello Petr,
It's true that Websocket should work with mod_cluster 1.3.1/1.3.5 but there's a bug: JBCS-291
It is related to JBCS and mod_clsuter. Look at the comments and you can follow it to receive any news about it.
Later we will look at the solutions and articles described here and update with that information to avoid misunderstandings.
Regards,
Arthur Ferreira
I have experience in the same environment.
Apache HTTPD + mod_cluster or mod_jk + JBoss EAP 6.x / 7.x
I have used websocket in the above environment.
In conclusion, it is impossible to use websocket in this configuration.
To enable it, the websocket url must use wstunnel separately.
I solved the problem with wstunnel without using mod_cluster and mod_jk as shown below.
# This file configures all the proxy modules:
LoadModule proxy_module modules/mod_proxy.so
#LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
#LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
#LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
# Websocket connection
<Proxy balancer://TEST_WS>
BalancerMember ws://192.168.0.81:8080 route=node11 timeout=3 retry=30
BalancerMember ws://192.168.0.82:8080 route=node21 timeout=3 retry=30
ProxySet stickysession=JSESSIONID|jsessionid lbmethod=byrequests failontimeout=on
</Proxy>
# AJP connection
<Proxy balancer://TEST_AJP>
BalancerMember ajp://192.168.0.81:8009 route=node11 timeout=3 retry=30
BalancerMember ajp://192.168.0.82:8009 route=node21 timeout=3 retry=30
ProxySet stickysession=JSESSIONID|jsessionid lbmethod=byrequests failontimeout=on
</Proxy>
# HTTP connection
<Proxy balancer://TEST_HTTP>
BalancerMember http://192.168.0.81:8080 route=node11 timeout=3 retry=30
BalancerMember http://192.168.0.82:8080 route=node21 timeout=3 retry=30
ProxySet stickysession=JSESSIONID|jsessionid lbmethod=byrequests failontimeout=on
</Proxy>
RewriteEngine On
# WebSocket request process
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /jboss-websocket-hello/(.*) balancer://TEST_WS/jboss-websocket-hello/$1 [P,L]
# HTTP request process
ProxyPass /jboss-websocket-hello balancer://TEST_AJP/jboss-websocket-hello
ProxyPassReverse /jboss-websocket-hello balancer://TEST_AJP/jboss-websocket-hello
Also, when using wstunnel, it is not recommended to use it with mod_cluster or mod_jk. In my experience, I remember that there was a problem in part.
https://issues.jboss.org/browse/JBCS-291?_sscc=t