httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: [users@httpd] Web sockets & proxypass - No protocol handler was valid for the URL
Date Thu, 05 Jan 2017 09:36:44 GMT
On Wed, Dec 28, 2016 at 3:53 PM, 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.

For the record (after private discussion with Adam), it seems that a
configuration like the below would work for http(s) and ws(s) on the
same URL:

  RewriteEngine on
  RewriteCond %{HTTP:Upgrade} "(?i)websocket"
  RewriteRule ^/(.*)$ wss://backend/$1 [P]
  ProxyPass / https://backend/

Actually it didn't work for him because of other app issues (Upgrade
missing), but httpd behaved correctly with this.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message