Hi Eric,

Thanks so much for taking the time to generate a working config.

Initially it didn’t work (the RewriteCond was not matching), so I performed a 
packet capture on the request leaving my browser, and compared it with a packet 
capture arriving at the apache process.  This revealed that the Upgrade header 
was set by browser (as previously noted), but was missing when request arrived 
at Apache process.

Turns out that my Squid proxy server was stripping off the Upgrade header, as 
per this discussion thread here:

http://lists.squid-cache.org/pipermail/squid-users/2017-January/013953.html 
<http://lists.squid-cache.org/pipermail/squid-users/2017-January/013953.html>

After bypassing squid, the config worked perfectly.  

Thanks again for your assistance Eric.

Regards,
Damien.

> On 11 Sep 2017, at 8:51 am, Eric Covener <cove...@gmail.com> wrote:
> 
> For me, the setenvif worked but the overall test failed. I had misread
> something in how mod_proxy and mod_rewrite depend on eachother.
> 
> I don't know why your SetEnvIf didn't fire.
> 
> Here's what seemed to work for me:
> 
>  RewriteEngine ON
> 
>  RewriteCond %{HTTP:Upgrade} "(?i)websocket"
>  RewriteRule ^/(.*)$ ws://localhost:3000/$1 [P,L]
> 
>  RewriteRule ^/(.*)$ http://localhost:3000/$1 [P]
>  # Force a worker to be created w/o ProxyPass
>  <Proxy "http://localhost:3000";>
>    ProxySet connectiontimeout=5
>  </Proxy>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
> 

Reply via email to