summaryrefslogtreecommitdiffstats
path: root/docs/en/gun/1.0/manual/gun.ws_upgrade/index.html
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-06-13 09:54:12 +0200
committerLoïc Hoguin <[email protected]>2018-06-13 09:54:12 +0200
commit92b54aacc0de5446dd5497c39897b0bbff72e626 (patch)
treec3a98cfec636d1271f5804e5c19b35b208bba00d /docs/en/gun/1.0/manual/gun.ws_upgrade/index.html
parent8b5c3dc972b99f174750123c9e4abc96259c34a9 (diff)
downloadninenines.eu-92b54aacc0de5446dd5497c39897b0bbff72e626.tar.gz
ninenines.eu-92b54aacc0de5446dd5497c39897b0bbff72e626.tar.bz2
ninenines.eu-92b54aacc0de5446dd5497c39897b0bbff72e626.zip
Rebuild using Asciideck
Diffstat (limited to 'docs/en/gun/1.0/manual/gun.ws_upgrade/index.html')
-rw-r--r--docs/en/gun/1.0/manual/gun.ws_upgrade/index.html171
1 files changed, 54 insertions, 117 deletions
diff --git a/docs/en/gun/1.0/manual/gun.ws_upgrade/index.html b/docs/en/gun/1.0/manual/gun.ws_upgrade/index.html
index d74702db..998ffe89 100644
--- a/docs/en/gun/1.0/manual/gun.ws_upgrade/index.html
+++ b/docs/en/gun/1.0/manual/gun.ws_upgrade/index.html
@@ -62,144 +62,81 @@
<h1 class="lined-header"><span>gun:ws_upgrade(3)</span></h1>
-<div class="sect1">
<h2 id="_name">Name</h2>
-<div class="sectionbody">
-<div class="paragraph"><p>gun:ws_upgrade - Upgrade to Websocket</p></div>
-</div>
-</div>
-<div class="sect1">
+<p>gun:ws_upgrade - Upgrade to Websocket</p>
<h2 id="_description">Description</h2>
-<div class="sectionbody">
-<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
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">ws_upgrade</span></span>(<span style="color: #009900">ConnPid</span>, <span style="color: #009900">Path</span>)
- <span style="color: #990000">-&gt;</span> <span style="font-weight: bold"><span style="color: #000000">ws_upgrade</span></span>(<span style="color: #009900">ConnPid</span>, <span style="color: #009900">Path</span>, [])
-
-<span style="font-weight: bold"><span style="color: #000000">ws_upgrade</span></span>(<span style="color: #009900">ConnPid</span>, <span style="color: #009900">Path</span>, <span style="color: #009900">Headers</span>)
- <span style="color: #990000">-&gt;</span> <span style="color: #009900">StreamRef</span>
-
-<span style="font-weight: bold"><span style="color: #000000">ws_upgrade</span></span>(<span style="color: #009900">ConnPid</span>, <span style="color: #009900">Path</span>, <span style="color: #009900">Headers</span>, <span style="color: #009900">WsOpts</span>)
- <span style="color: #990000">-&gt;</span> <span style="color: #009900">StreamRef</span>
-
-<span style="color: #009900">ConnPid</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000080">pid</span></span>()
-<span style="color: #009900">Path</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">iodata</span></span>()
-<span style="color: #009900">Headers</span> <span style="color: #990000">::</span> [{<span style="font-weight: bold"><span style="color: #000080">binary</span></span>(), <span style="font-weight: bold"><span style="color: #000000">iodata</span></span>()}]
-<span style="color: #009900">WsOpts</span> <span style="color: #990000">::</span> <span style="color: #FF6600">gun</span><span style="color: #990000">:</span><span style="color: #FF6600">ws_opts</span>
-<span style="color: #009900">StreamRef</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000080">reference</span></span>()</tt></pre></div></div>
-<div class="paragraph"><p>Upgrade to Websocket.</p></div>
-<div class="paragraph"><p>The behavior of this function depends on the protocol
-selected.</p></div>
-<div class="paragraph"><p>HTTP/1.1 cannot handle Websocket and HTTP requests
-concurrently. The upgrade, if successful, will result
-in the complete takeover of the connection. Any
-subsequent HTTP requests will be rejected.</p></div>
-<div class="paragraph"><p>Gun does not currently support Websocket over HTTP/2.</p></div>
-<div class="paragraph"><p>By default Gun will take the Websocket options from
-the connection&#8217;s <code>ws_opts</code>.</p></div>
-</div>
-</div>
-<div class="sect1">
+<pre><tt><b><font color="#000000">ws_upgrade</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">Path</font>)
+ <font color="#990000">-&gt;</font> <b><font color="#000000">ws_upgrade</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">Path</font>, [])
+
+<b><font color="#000000">ws_upgrade</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">Path</font>, <font color="#009900">Headers</font>)
+ <font color="#990000">-&gt;</font> <font color="#009900">StreamRef</font>
+
+<b><font color="#000000">ws_upgrade</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">Path</font>, <font color="#009900">Headers</font>, <font color="#009900">WsOpts</font>)
+ <font color="#990000">-&gt;</font> <font color="#009900">StreamRef</font>
+
+<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
+<font color="#009900">Path</font> <font color="#990000">::</font> <b><font color="#000000">iodata</font></b>()
+<font color="#009900">Headers</font> <font color="#990000">::</font> [{<b><font color="#000080">binary</font></b>(), <b><font color="#000000">iodata</font></b>()}]
+<font color="#009900">WsOpts</font> <font color="#990000">::</font> <font color="#FF6600">gun</font><font color="#990000">:</font><font color="#FF6600">ws_opts</font>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+</div></div>
+<p>Upgrade to Websocket.</p>
+<p>The behavior of this function depends on the protocol selected.</p>
+<p>HTTP/1.1 cannot handle Websocket and HTTP requests concurrently. The upgrade, if successful, will result in the complete takeover of the connection. Any subsequent HTTP requests will be rejected.</p>
+<p>Gun does not currently support Websocket over HTTP/2.</p>
+<p>By default Gun will take the Websocket options from the connection&apos;s <code>ws_opts</code>.</p>
<h2 id="_arguments">Arguments</h2>
-<div class="sectionbody">
-<div class="dlist"><dl>
-<dt class="hdlist1">
-ConnPid
-</dt>
-<dd>
-<p>
-The pid of the Gun connection process.
-</p>
+<dl><dt>ConnPid</dt>
+<dd><p>The pid of the Gun connection process.</p>
</dd>
-<dt class="hdlist1">
-Path
-</dt>
-<dd>
-<p>
-Path to the resource.
-</p>
+<dt>Path</dt>
+<dd><p>Path to the resource.</p>
</dd>
-<dt class="hdlist1">
-Headers
-</dt>
-<dd>
-<p>
-Additional request headers.
-</p>
+<dt>Headers</dt>
+<dd><p>Additional request headers.</p>
</dd>
-<dt class="hdlist1">
-WsOpts
-</dt>
-<dd>
-<p>
-Configuration for the Websocket protocol.
-</p>
+<dt>WsOpts</dt>
+<dd><p>Configuration for the Websocket protocol.</p>
</dd>
-</dl></div>
-</div>
-</div>
-<div class="sect1">
+</dl>
<h2 id="_return_value">Return value</h2>
-<div class="sectionbody">
-<div class="paragraph"><p>A reference that identifies the newly created stream is
-returned. It is this reference that must be passed in
-subsequent calls and will be received in messages related
-to this new stream.</p></div>
-</div>
-</div>
-<div class="sect1">
+<p>A reference that identifies the newly created stream is returned. It is this reference that must be passed in subsequent calls and will be received in messages related to this new stream.</p>
<h2 id="_changelog">Changelog</h2>
-<div class="sectionbody">
-<div class="ulist"><ul>
-<li>
-<p>
-<strong>1.0</strong>: Function introduced.
-</p>
+<ul><li><strong>1.0</strong>: Function introduced.
</li>
-</ul></div>
-</div>
-</div>
-<div class="sect1">
+</ul>
<h2 id="_examples">Examples</h2>
-<div class="sectionbody">
-<div class="listingblock">
-<div class="title">Upgrade to Websocket</div>
-<div class="content"><!-- Generator: GNU source-highlight
+<div class="listingblock"><div class="title">Upgrade to Websocket</div>
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">StreamRef</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">gun:ws_upgrade</span></span>(<span style="color: #009900">ConnPid</span>, <span style="color: #FF0000">"/ws"</span>, [
- {<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"sec-websocket-protocol"</span><span style="color: #990000">&gt;&gt;</span>, <span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"chat"</span><span style="color: #990000">&gt;&gt;</span>}
-])<span style="color: #990000">.</span>
-<span style="font-weight: bold"><span style="color: #0000FF">receive</span></span>
- {<span style="color: #FF6600">gun_upgrade</span>, <span style="color: #009900">ConnPid</span>, <span style="color: #009900">StreamRef</span>, [<span style="color: #990000">&lt;&lt;</span><span style="color: #FF0000">"websocket"</span><span style="color: #990000">&gt;&gt;</span>], <span style="color: #990000">_</span>} <span style="color: #990000">-&gt;</span>
- <span style="color: #FF6600">ok</span>
-<span style="font-weight: bold"><span style="color: #0000FF">after</span></span> <span style="color: #993399">5000</span> <span style="color: #990000">-&gt;</span>
- <span style="font-weight: bold"><span style="color: #000000">error</span></span>(<span style="color: #FF6600">timeout</span>)
-<span style="font-weight: bold"><span style="color: #0000FF">end</span></span><span style="color: #990000">.</span></tt></pre></div></div>
-<div class="listingblock">
-<div class="title">Upgrade to Websocket with different options</div>
-<div class="content"><!-- Generator: GNU source-highlight
+<pre><tt><font color="#009900">StreamRef</font> <font color="#990000">=</font> <b><font color="#000000">gun:ws_upgrade</font></b>(<font color="#009900">ConnPid</font>, <font color="#FF0000">"/ws"</font>, [
+ {<font color="#990000">&lt;&lt;</font><font color="#FF0000">"sec-websocket-protocol"</font><font color="#990000">&gt;&gt;</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"chat"</font><font color="#990000">&gt;&gt;</font>}
+])<font color="#990000">.</font>
+<b><font color="#0000FF">receive</font></b>
+ {<font color="#FF6600">gun_upgrade</font>, <font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, [<font color="#990000">&lt;&lt;</font><font color="#FF0000">"websocket"</font><font color="#990000">&gt;&gt;</font>], <font color="#990000">_</font>} <font color="#990000">-&gt;</font>
+ <font color="#FF6600">ok</font>
+<b><font color="#0000FF">after</font></b> <font color="#993399">5000</font> <font color="#990000">-&gt;</font>
+ <b><font color="#000000">error</font></b>(<font color="#FF6600">timeout</font>)
+<b><font color="#0000FF">end</font></b><font color="#990000">.</font></tt></pre>
+</div></div>
+<div class="listingblock"><div class="title">Upgrade to Websocket with different options</div>
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="color: #009900">StreamRef</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">gun:ws_upgrade</span></span>(<span style="color: #009900">ConnPid</span>, <span style="color: #FF0000">"/ws"</span>, [], #{
- <span style="color: #0000FF">compress</span> <span style="color: #990000">=&gt;</span> <span style="color: #000080">false</span>
-})<span style="color: #990000">.</span></tt></pre></div></div>
-</div>
-</div>
-<div class="sect1">
+<pre><tt><font color="#009900">StreamRef</font> <font color="#990000">=</font> <b><font color="#000000">gun:ws_upgrade</font></b>(<font color="#009900">ConnPid</font>, <font color="#FF0000">"/ws"</font>, [], #{
+ <font color="#0000FF">compress</font> <font color="#990000">=&gt;</font> <font color="#000080">false</font>
+})<font color="#990000">.</font></tt></pre>
+</div></div>
<h2 id="_see_also">See also</h2>
-<div class="sectionbody">
-<div class="paragraph"><p><a href="../gun">gun(3)</a>,
-<a href="../gun.ws_send">gun:ws_send(3)</a>,
-<a href="../gun_upgrade">gun_upgrade(3)</a>,
-<a href="../gun_ws">gun_ws(3)</a></p></div>
-</div>
-</div>
+<p><a href="../gun">gun(3)</a>, <a href="../gun.ws_send">gun:ws_send(3)</a>, <a href="../gun_upgrade">gun_upgrade(3)</a>, <a href="../gun_ws">gun_ws(3)</a></p>
+