From 989647434654f341c8edfe41e767b955ae1da077 Mon Sep 17 00:00:00 2001 From: Ricardo Carrillo Cruz Date: Wed, 11 Feb 2015 12:31:07 +0000 Subject: [PATCH] Add support for Apache mod_proxy_wstunnel This change allows Apache servers with mod_proxy_wstunnel enabled to pass thru Websocket connections to Etherpad, providing the browser supports that. Change-Id: I4f595f456e0d280c6f05958a36552213dd6cf1e2 --- templates/etherpadlite.vhost.erb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/etherpadlite.vhost.erb b/templates/etherpadlite.vhost.erb index e6711bb..c0b1888 100644 --- a/templates/etherpadlite.vhost.erb +++ b/templates/etherpadlite.vhost.erb @@ -66,6 +66,14 @@ RewriteCond %{REQUEST_URI} !/robots.txt RewriteRule ^/+(.+)$ https://<%= scope.lookupvar("etherpad_lite::apache::vhost_name") %>/p/$1 [NC,L,R=301] + + RewriteCond %{REQUEST_URI} ^/socket.io [NC] + RewriteCond %{QUERY_STRING} transport=websocket [NC] + RewriteRule /(.*) ws://localhost:9001/$1 [P,L] + ProxyPass /socket.io http://localhost:9001 + ProxyPassReverse /socket.io http://localhost:9001 + + RewriteRule ^/(.*)$ http://localhost:9001/$1 [P] ProxyPassReverse / http://localhost:9001/