diff options
author | Loïc Hoguin <[email protected]> | 2017-11-09 12:46:23 +0000 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-11-09 12:46:23 +0000 |
commit | 28b5bf18a3be3b933a76f8b8912c8ee55238cdc6 (patch) | |
tree | c7cc0a97e1011cc1de911659a4ac188c3a25c40c /docs/en/cowboy/2.0/guide/ws_handlers | |
parent | 51b883ea1849ed186de63d3b76a2b66fe317ff9d (diff) | |
download | ninenines.eu-28b5bf18a3be3b933a76f8b8912c8ee55238cdc6.tar.gz ninenines.eu-28b5bf18a3be3b933a76f8b8912c8ee55238cdc6.tar.bz2 ninenines.eu-28b5bf18a3be3b933a76f8b8912c8ee55238cdc6.zip |
Update documentation for Cowboy 2.1
Diffstat (limited to 'docs/en/cowboy/2.0/guide/ws_handlers')
-rw-r--r-- | docs/en/cowboy/2.0/guide/ws_handlers/index.html | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/docs/en/cowboy/2.0/guide/ws_handlers/index.html b/docs/en/cowboy/2.0/guide/ws_handlers/index.html index f17b1093..8e867c6f 100644 --- a/docs/en/cowboy/2.0/guide/ws_handlers/index.html +++ b/docs/en/cowboy/2.0/guide/ws_handlers/index.html @@ -7,7 +7,7 @@ <meta name="description" content=""> <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara"> - <meta name="generator" content="Hugo 0.26" /> + <meta name="generator" content="Hugo 0.30.2" /> <title>Nine Nines: Websocket handlers</title> @@ -122,19 +122,18 @@ be:</p></div> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><tt><span style="font-weight: bold"><span style="color: #000000">init</span></span>(<span style="color: #009900">Req0</span>, <span style="color: #009900">State</span>) <span style="color: #990000">-></span> - <span style="font-weight: bold"><span style="color: #0000FF">case</span></span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:parse_header</span></span>(<span style="color: #990000"><<</span><span style="color: #FF0000">"sec-websocket-protocol"</span><span style="color: #990000">>></span>, <span style="color: #009900">Req0</span>) <span style="font-weight: bold"><span style="color: #0000FF">of</span></span> +<pre><tt><span style="font-weight: bold"><span style="color: #000000">init</span></span>(<span style="color: #009900">Req</span>, <span style="color: #009900">State</span>) <span style="color: #990000">-></span> + <span style="font-weight: bold"><span style="color: #0000FF">case</span></span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:parse_header</span></span>(<span style="color: #990000"><<</span><span style="color: #FF0000">"sec-websocket-protocol"</span><span style="color: #990000">>></span>, <span style="color: #009900">Req</span>) <span style="font-weight: bold"><span style="color: #0000FF">of</span></span> <span style="color: #000080">undefined</span> <span style="color: #990000">-></span> - {<span style="color: #FF6600">cowboy_websocket</span>, <span style="color: #009900">Req0</span>, <span style="color: #009900">State</span>}; + {<span style="color: #FF6600">cowboy_websocket</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}; <span style="color: #009900">Subprotocols</span> <span style="color: #990000">-></span> <span style="font-weight: bold"><span style="color: #0000FF">case</span></span> <span style="font-weight: bold"><span style="color: #000000">lists:keymember</span></span>(<span style="color: #990000"><<</span><span style="color: #FF0000">"mqtt"</span><span style="color: #990000">>></span>, <span style="color: #993399">1</span>, <span style="color: #009900">Subprotocols</span>) <span style="font-weight: bold"><span style="color: #0000FF">of</span></span> <span style="color: #000080">true</span> <span style="color: #990000">-></span> - <span style="color: #009900">Req</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:set_resp_header</span></span>(<span style="color: #990000"><<</span><span style="color: #FF0000">"sec-websocket-protocol"</span><span style="color: #990000">>></span>, - <span style="color: #990000"><<</span><span style="color: #FF0000">"mqtt"</span><span style="color: #990000">>></span>, <span style="color: #009900">Req0</span>), - {<span style="color: #FF6600">cowboy_websocket</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}; + <span style="color: #009900">Req2</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:set_resp_header</span></span>(<span style="color: #990000"><<</span><span style="color: #FF0000">"sec-websocket-protocol"</span><span style="color: #990000">>></span>, + <span style="color: #990000"><<</span><span style="color: #FF0000">"mqtt"</span><span style="color: #990000">>></span>, <span style="color: #009900">Req</span>), + {<span style="color: #FF6600">cowboy_websocket</span>, <span style="color: #009900">Req2</span>, <span style="color: #009900">State</span>}; <span style="color: #000080">false</span> <span style="color: #990000">-></span> - <span style="color: #009900">Req</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:reply</span></span>(<span style="color: #993399">400</span>, <span style="color: #009900">Req0</span>), - {<span style="color: #FF6600">ok</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>} + {<span style="color: #FF6600">stop</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>} <span style="font-weight: bold"><span style="color: #0000FF">end</span></span> <span style="font-weight: bold"><span style="color: #0000FF">end</span></span><span style="color: #990000">.</span></tt></pre></div></div> </div> @@ -388,6 +387,8 @@ close frame will not be sent.</p></div> + <li><a href="/docs/en/cowboy/2.1/guide">2.1</a></li> + <li><a href="/docs/en/cowboy/2.0/guide">2.0</a></li> <li><a href="/docs/en/cowboy/1.0/guide">1.0</a></li> |