httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Teale <a...@believe.tv>
Subject Re: [users@httpd] Web sockets & proxypass - No protocol handler was valid for the URL
Date Wed, 28 Dec 2016 15:47:03 GMT
Yann & Eric thank you for getting back to me.

As far as I know the "normal" http traffic is via "/chat/" (well at least
that is visited page url).

When that page loads is connects to "/chat/stream" via the wss:// protocol
using a javascript library called "reconnecting-websocket".

So what I have expected to happen is that proxypass would catch the urls
that contain /chat/stream and proxy them to the app running on
localhost:8000 via the wss:// protocol - all other http/s traffic handled
by the app running via mod_wsgi.

I have just tried:
ProxyPass /chat/ https://localhost:8000/chat/
ProxyPass /chat/stream wss://localhost:8000/chat/stream

Now Apache just sits there and nothing loads -

[Wed Dec 28 12:41:14.523727 2016] [proxy:debug] [pid 45890]
mod_proxy.c(1198): [client 127.0.0.1:62404] AH01143: Running scheme https
handler (attempt 0)

[Wed Dec 28 12:41:14.523739 2016] [proxy:debug] [pid 45890]
proxy_util.c(2154): AH00942: HTTPS: has acquired connection for (localhost)

[Wed Dec 28 12:41:14.523749 2016] [proxy:debug] [pid 45890]
proxy_util.c(2208): [client 127.0.0.1:62404] AH00944: connecting
https://localhost:8000/chat/ to localhost:8000

[Wed Dec 28 12:41:14.523777 2016] [proxy:debug] [pid 45890]
proxy_util.c(2417): [client 127.0.0.1:62404] AH00947: connected /chat/ to
localhost:8000

[Wed Dec 28 12:41:14.523946 2016] [proxy:debug] [pid 45890]
proxy_util.c(2798): (61)Connection refused: AH00957: HTTPS: attempt to
connect to [::1]:8000 (localhost) failed

[Wed Dec 28 12:41:14.524222 2016] [proxy:debug] [pid 45890]
proxy_util.c(2807): AH02824: HTTPS: connection established with
127.0.0.1:8000 (localhost)

[Wed Dec 28 12:41:14.524266 2016] [proxy:debug] [pid 45890]
proxy_util.c(2975): AH00962: HTTPS: connection complete to [::1]:8000
(localhost)

[Wed Dec 28 12:41:14.524283 2016] [ssl:info] [pid 45890] [remote
127.0.0.1:8000] AH01964: Connection to child 0 established (server
alfred.local:80)


*Browser*
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /chat/.
Reason: Error reading from remote server














2016-12-28 11:57 GMT-03:00 Eric Covener <covener@gmail.com>:

> On Wed, Dec 28, 2016 at 9:53 AM, Eric Covener <covener@gmail.com> wrote:
> > On Tue, Dec 27, 2016 at 8:39 AM, Adam Teale <adam@believe.tv> wrote:
> >> Hi!
> >>
> >> I've been trying to setup a reverse proxy to a localhost websocket url.
> >>
> >> ProxyPass /chat/stream/ wss://localhost:8000/chat/stream/
> >> ProxyPassReverse /chat/stream/ wss://localhost:8000/chat/stream/
> >>
> >> I get an error in the apache error_log that reads:
> >>
> >> No protocol handler was valid for the URL /chat/stream/. If you are
> using a
> >> DSO version of mod_proxy, make sure the proxy submodules are included
> in the
> >> configuration using LoadModule.
> >>
> >> I have read a lot of pages via google of people using this method so I
> >> wonder if there is some issue in our setup/install of Apache that ships
> with
> >> Mac OS X 10.11 & Server.app 5.2?
> >>
> >> I have all the standard modules loaded in httpd_server_app.conf
> >>
> >> LoadModule proxy_module libexec/apache2/mod_proxy.so
> >> LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
> >> LoadModule proxy_wstunnel_module libexec/apache2/mod_proxy_wstunnel.so
> >>
> >> When I access the application running on localhost:8000 directly on the
> >> server everything works fine
> >>
> >> Any ideas what could be going on?
> >
> > There is a bug in this area, but you need to decide what you expect to
> > happen with non-websockets requests to /chat/stream/ which is what's
> > happening here.
> >
> > If you intend to proxy it, you might need to change the LoadModule
> > order of mod_proxy_http and mod_proxy_wstunnel to try to get a
> > different order at runtime.
> >
> > If you expect to satisfy it somehow else... you have a bit of a
> > puzzler.  I'm not sure there's a good recipe for this.  Otherwise as
> > Yann said, you should use different URLs if you can.
>
> Yann pointed out that the shareing is doomed for other reasons, so
> disregard the above!
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Mime
View raw message