]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_proxy_wstunnel.xml
Merge in APR[-util] macros from branches/trunk-buildconf-noapr
[apache] / docs / manual / mod / mod_proxy_wstunnel.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_proxy_wstunnel.xml.meta">
24
25 <name>mod_proxy_wstunnel</name>
26 <description>Websockets support module for
27 <module>mod_proxy</module></description>
28 <status>Extension</status>
29 <sourcefile>mod_proxy_wstunnel.c</sourcefile>
30 <identifier>proxy_wstunnel_module</identifier>
31 <compatibility>Available in httpd 2.4.5 and later</compatibility>
32
33 <summary>
34     <p>This module <em>requires</em> the service of <module
35     >mod_proxy</module>. It provides support for the tunnelling of web
36     socket connections to a backend websockets server. The connection
37     is automatically upgraded to a websocket connection:</p>
38
39     <example><title>HTTP Response</title>
40         <highlight language="config">
41 Upgrade: WebSocket
42 Connection: Upgrade
43         </highlight>
44     </example>
45
46 <p>Proxying requests to a websockets server like <code>echo.websocket.org</code> can be done using the
47 <directive type="ProxyPass" module="mod_proxy">ProxyPass</directive> directive:</p>
48     <highlight language="config">
49 ProxyPass "/ws2/"  "ws://echo.websocket.org/"
50 ProxyPass "/wss2/" "wss://echo.websocket.org/"
51     </highlight>
52
53 <p>Load balancing for multiple backends can be achieved using <module>mod_proxy_balancer</module>.</p>
54
55 <p>In fact the module can be used to upgrade to other protocols, you can set the <code>upgrade</code>
56 parameter in the <directive type="ProxyPass" module="mod_proxy">ProxyPass</directive>
57 directive to allow the module to accept other protocol.
58 NONE means you bypass the check for the header but still upgrade to WebSocket.</p>
59 </summary>
60
61 <seealso><module>mod_proxy</module></seealso>
62
63 <directivesynopsis>
64 <name>ProxyWebsocketAsync</name>
65 <description>Instructs this module to try to create an asynchronous tunnel</description>
66 <syntax>ProxyWebsocketAsync ON|OFF</syntax>
67 <contextlist><context>server config</context>
68 <context>virtual host</context>
69 </contextlist>
70
71 <usage>
72     <p>This directive instructs the server to try to create an asynchronous tunnel.
73     If the current MPM does not support the necessary features, a synchronous
74     tunnel is used.</p>
75     <note><title>Note</title><p>Async support is experimental and subject
76     to change.</p></note>
77 </usage>
78 </directivesynopsis>
79
80 <directivesynopsis>
81 <name>ProxyWebsocketIdleTimeout</name>
82 <description>Sets the maximum amount of time to wait for data on the websockets tunnel</description>
83 <syntax>ProxyWebsocketIdleTimeout <var>num</var>[ms]</syntax>
84 <default>ProxyWebsocketIdleTimeout 0</default>
85 <contextlist><context>server config</context>
86 <context>virtual host</context>
87 </contextlist>
88
89 <usage>
90     <p>This directive imposes a maximum amount of time for the tunnel to be
91     left open while idle. The timeout is considered in seconds by default, but
92     it is possible to increase the time resolution to milliseconds
93     adding the <em>ms</em> suffix.</p>
94 </usage>
95 </directivesynopsis>
96
97 <directivesynopsis>
98 <name>ProxyWebsocketAsyncDelay</name>
99 <description>Sets the amount of time the tunnel waits synchronously for data</description>
100 <syntax>ProxyWebsocketAsyncDelay <var>num</var>[ms]</syntax>
101 <default>ProxyWebsocketAsyncDelay 0</default>
102 <contextlist><context>server config</context>
103 <context>virtual host</context>
104 </contextlist>
105
106 <usage>
107     <p>If <directive>ProxyWebsocketAsync</directive> is enabled, this directive
108     controls how long the server synchronously waits for more data. The timeout
109     is considered in seconds by default, but it is possible to increase
110     the time resolution to milliseconds adding the <em>ms</em> suffix.</p>
111
112     <note><title>Note</title><p>Async support is experimental and subject
113     to change. </p></note>
114
115 </usage>
116 </directivesynopsis>
117 </modulesynopsis>