Bug 1180572 - [httpd] mod_proxy_wstunnel not loaded automatically
Summary: [httpd] mod_proxy_wstunnel not loaded automatically
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss Web Server 3
Classification: Retired
Component: unspecified
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: DR01
: 3.0.0
Assignee: Weinan Li
QA Contact: Pavel Slavicek
URL:
Whiteboard:
Depends On:
Blocks: 1178630
TreeView+ depends on / blocked
 
Reported: 2015-01-09 13:39 UTC by Michal Haško
Modified: 2020-03-27 18:35 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-03-27 18:35:40 UTC
Embargoed:


Attachments (Terms of Use)

Description Michal Haško 2015-01-09 13:39:15 UTC
Description of problem:
mod_proxy_wstunnel is not loaded autmatically, the following is missing in httpd/conf.d/00-proxy.conf:

    LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so

Version-Release number of selected component (if applicable):
3.0.0-DR0.2

Comment 1 Weinan Li 2015-01-11 03:45:24 UTC
fix:

[weli@dhcp-66-78-87 httpd24-jws3-el7]$ git diff
diff --git a/00-proxy.conf b/00-proxy.conf
index a446822..6ce89a4 100644
--- a/00-proxy.conf
+++ b/00-proxy.conf
@@ -13,3 +13,5 @@ LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
 LoadModule proxy_ftp_module modules/mod_proxy_ftp.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

verification:

[weli@dhcp-66-78-87 sbin]$ ./apachectl -M | grep wstunnel
 proxy_wstunnel_module (shared)

Comment 2 Weinan Li 2015-01-12 15:14:25 UTC
more verification:

1. write a nodejs websocket service:

# ws.js
var ws = require("nodejs-websocket")

var server = ws.createServer(function (conn) {
    console.log("New connection")
    
    conn.on("text", function (str) {
        console.log("Received " + str)
        conn.sendText(str.toUpperCase() + "!!!")
    })
    
    conn.on("close", function (code, reason) {
        console.log("Connection closed")
    })
    
}).listen(8088)


2. write a ruby test client:

# ws-client.rb
require 'faye/websocket'
require 'eventmachine'

EM.run {
    ws = Faye::WebSocket::Client.new('http://127.0.0.1/ws/')
    
    ws.on :open do |event|
        p [:open]
        ws.send('Hello, Martian!')
    end
    
    ws.on :message do |event|
        p [:message, event.data]
    end
    
    ws.on :close do |event|
        p [:close, event.code, event.reason]
        ws = nil
    end
}

3. setup httpd proxy properly:

LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
...
ProxyPass /ws/  ws://127.0.0.1:8088/
ProxyPassReverse /ws/  ws://127.0.0.1:8088/
...
LogLevel debug

4. start nodejs service:

[weli@dhcp-66-78-87 work]$ node ws.js

5. start httpd

[weli@dhcp-66-78-87 sbin]$ sudo ./apachectl restart

6. run ws-client.rb

[weli@dhcp-66-78-87 work]$ ruby ws-client.rb
[:open]
[:message, "HELLO, MARTIAN!!!!"]

nodejs server side:

[weli@dhcp-66-78-87 work]$ node ws.js
New connection
Received Hello, Martian!

httpd log:

[Mon Jan 12 22:50:57.097895 2015] [proxy_wstunnel:debug] [pid 23014] mod_proxy_wstunnel.c(331): [client 127.0.0.1:46872] AH02451: serving URL ws://127.0.0.1:8088/
[Mon Jan 12 22:50:57.097902 2015] [proxy:debug] [pid 23014] proxy_util.c(2020): AH00942: WS: has acquired connection for (127.0.0.1)
[Mon Jan 12 22:50:57.097933 2015] [proxy:debug] [pid 23014] proxy_util.c(2072): [client 127.0.0.1:46872] AH00944: connecting ws://127.0.0.1:8088/ to 127.0.0.1:8088
[Mon Jan 12 22:50:57.098021 2015] [proxy:debug] [pid 23014] proxy_util.c(2194): [client 127.0.0.1:46872] AH00947: connected / to 127.0.0.1:8088
[Mon Jan 12 22:50:57.098225 2015] [proxy:debug] [pid 23014] proxy_util.c(2598): AH00962: WS: connection complete to 127.0.0.1:8088 (127.0.0.1)

Comment 3 Libor Fuka 2015-01-20 13:50:10 UTC
Verified with DR1 build.


Note You need to log in before you can comment on or make changes to this bug.