From: Eric Covener Date: Sun, 9 Aug 2020 19:11:17 +0000 (+0000) Subject: xform X-Git-Tag: 2.4.47~297 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86fcacfed5b7f10f7961019d1f3b3afabb6b8e58;p=thirdparty%2Fapache%2Fhttpd.git xform git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1880723 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_proxy_wstunnel.html.en b/docs/manual/mod/mod_proxy_wstunnel.html.en index 7506ccb8da0..e3ff115c7b3 100644 --- a/docs/manual/mod/mod_proxy_wstunnel.html.en +++ b/docs/manual/mod/mod_proxy_wstunnel.html.en @@ -51,6 +51,26 @@ Connection: Upgrade ProxyPass "/wss2/" "wss://echo.websocket.org/" +

Proxying both HTTP and websockets at the same time, with a specific set of URL's being +websocket-only, can be done by specifying the websockets +ProxyPass directive before the +HTTP directive:

+
ProxyPassMatch ^/(myApp/ws)$  ws://example.com:9080/$1
+ProxyPass / http://example.com:9080/
+ + +

Proxying both HTTP and websockets at the same time, where the websockets URL's are not +websocket-only or not known in advance can be done by using the +RewriteRule directive to +configure the websockets proxying:

+
ProxyPass / http://example.com:9080/
+RewriteEngine on
+RewriteCond %{HTTP:Upgrade} websocket [NC]
+RewriteCond %{HTTP:Connection} upgrade [NC]
+RewriteRule ^/?(.*) "ws://example.com:9080/$1" [P,L]
+ + +

Load balancing for multiple backends can be achieved using mod_proxy_balancer.

In fact the module can be used to upgrade to other protocols, you can set the upgrade