[master] 86cbba9 Re-add snippet needed for websockets support
Federico G. Schwindt
fgsch at lodoss.net
Wed Feb 24 00:49:35 CET 2016
commit 86cbba9c12eb6c508b4d207797c8af2c90bab973
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