https://bz.apache.org/bugzilla/show_bug.cgi?id=65958

            Bug ID: 65958
           Summary: mod_proxy_wstunnel doesn't use UDS (UNIX domain
                    socket) if pseudo-url points to valid virtualhost
           Product: Apache httpd-2
           Version: 2.4.37
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy_wstunnel
          Assignee: bugs@httpd.apache.org
          Reporter: apache....@stefan-neufeind.de
  Target Milestone: ---

Environment is a ruby-application with his own puma-webserver running on a
unix-socket.

I was using a SSL-virtualhost to provide an application, internally http over
the unix-socket was used instead of https.

What works fine with mod_proxy_http:
ProxyPass / unix:///home/user/puma.sock|http://localhost/
ProxyPassReverse / unix:///home/user/puma.sock|http://localhost/

To use a URL with websockets over the same socket I used:
ProxyPass /cable unix:///home/user/puma.sock|ws://localhost/cable
ProxyPassReverse /cable unix:///home/user/puma.sock|ws://localhost/cable

Logs showed that it actually connected to localhost:80 instead of using the
unix-socket. I suspect that is due to the fact that a virtualhost exists on
port 80.

  proxy_util.c(3090): AH02824: WS: connection established with [::1]:80 (*)

But for mod_proxy_http it worked as expected and can also be seen in the
proxy-log:

  proxy_util.c(2431): [client 2a02:908:963:dc00::bcd8:52894] AH02545: http: has
determined UDS as /home/user/puma.sock

What worked fine was using some dummy-port (which does not exist!) in the
pseudo-url:
ProxyPass /cable unix:///home/user/puma.sock|ws://localhost:666/cable
ProxyPassReverse /cable unix:///home/user/puma.sock|ws://localhost:666/cable

This then also triggers the WS-handler to collectly use UDS.


Since http and wstunnel behave different in this regard, I wonder whether it is
possible to unify their behaviour. And since I provided a unix-socket the
expected behaviour would of course be to use that UDS no matter what URL is
specified after the pipe (as long as it begins with ws:// or wss:// to trigger
using the WS-handler).


Unfortunately I can't retest this with a newer Apache than 2.4.37 in the
current setup currently. I found in the docs that probably in 2.4.47 there were
changes in mod_proxy_wstunnel?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscr...@httpd.apache.org
For additional commands, e-mail: bugs-h...@httpd.apache.org

Reply via email to