[4.1] af29bc7 Re-add snippet needed for websockets support

Federico G. Schwindt fgsch at lodoss.net
Thu Feb 25 13:32:26 CET 2016


commit af29bc7d735f53b6d801286feb31795063c0a8d7
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Tue Feb 23 23:40:43 2016 +0000

    Re-add snippet needed for websockets support
    
    Pointed out by nirn on irc.

diff --git a/doc/sphinx/users-guide/vcl-example-websockets.rst b/doc/sphinx/users-guide/vcl-example-websockets.rst
index 24ea561..9401b37 100644
--- a/doc/sphinx/users-guide/vcl-example-websockets.rst
+++ b/doc/sphinx/users-guide/vcl-example-websockets.rst
@@ -5,10 +5,17 @@ Adding WebSockets support
 WebSockets is a technology for creating a bidirectional stream-based
 channel over HTTP.
 
-To run WebSockets through Varnish you need to pipe it as follows::
+To run WebSockets through Varnish you need to pipe the request and copy
+the Upgrade header as follows::
 
     sub vcl_recv {
         if (req.http.upgrade ~ "(?i)websocket") {
             return (pipe);
         }
     }
+
+    sub vcl_pipe {
+        if (req.http.upgrade) {
+            set bereq.http.upgrade = req.http.upgrade;
+        }
+    }



More information about the varnish-commit mailing list