summaryrefslogtreecommitdiffstats
path: root/docs/en/gun/2.0/manual
diff options
context:
space:
mode:
Diffstat (limited to 'docs/en/gun/2.0/manual')
-rw-r--r--docs/en/gun/2.0/manual/gun.await/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.await_body/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.await_up/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.cancel/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.connect/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.data/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.delete/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.flush/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.get/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.head/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.headers/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.info/index.html5
-rw-r--r--docs/en/gun/2.0/manual/gun.open/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.open_unix/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.options/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.patch/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.post/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.put/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.request/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.stream_info/index.html24
-rw-r--r--docs/en/gun/2.0/manual/gun.update_flow/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun.ws_send/index.html28
-rw-r--r--docs/en/gun/2.0/manual/gun.ws_upgrade/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun/index.html66
-rw-r--r--docs/en/gun/2.0/manual/gun_app/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun_data/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun_down/index.html4
-rw-r--r--docs/en/gun/2.0/manual/gun_error/index.html4
-rw-r--r--docs/en/gun/2.0/manual/gun_event/index.html573
-rw-r--r--docs/en/gun/2.0/manual/gun_inform/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun_push/index.html4
-rw-r--r--docs/en/gun/2.0/manual/gun_response/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun_trailers/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun_tunnel_up/index.html (renamed from docs/en/gun/2.0/manual/gun_socks_up/index.html)27
-rw-r--r--docs/en/gun/2.0/manual/gun_up/index.html4
-rw-r--r--docs/en/gun/2.0/manual/gun_upgrade/index.html2
-rw-r--r--docs/en/gun/2.0/manual/gun_ws/index.html2
-rw-r--r--docs/en/gun/2.0/manual/index.html2
38 files changed, 717 insertions, 78 deletions
diff --git a/docs/en/gun/2.0/manual/gun.await/index.html b/docs/en/gun/2.0/manual/gun.await/index.html
index 9f49dadb..dbe34b83 100644
--- a/docs/en/gun/2.0/manual/gun.await/index.html
+++ b/docs/en/gun/2.0/manual/gun.await/index.html
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#990000">-&gt;</font> <font color="#009900">Result</font>
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">MonitorRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
<font color="#009900">Timeout</font> <font color="#990000">::</font> <b><font color="#000000">timeout</font></b>()
<font color="#009900">Result</font> <font color="#990000">::</font> <b><font color="#000000">tuple</font></b>() <font color="#990000">-</font> <font color="#FF6600">see</font> <font color="#FF6600">below</font></tt></pre>
diff --git a/docs/en/gun/2.0/manual/gun.await_body/index.html b/docs/en/gun/2.0/manual/gun.await_body/index.html
index fcb9d814..f9df33ec 100644
--- a/docs/en/gun/2.0/manual/gun.await_body/index.html
+++ b/docs/en/gun/2.0/manual/gun.await_body/index.html
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#990000">-&gt;</font> {<font color="#FF6600">ok</font>, <font color="#009900">Body</font>} | {<font color="#FF6600">ok</font>, <font color="#009900">Body</font>, <font color="#009900">Trailers</font>} | {<font color="#FF6600">error</font>, <font color="#009900">Reason</font>}
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">MonitorRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
<font color="#009900">Timeout</font> <font color="#990000">::</font> <b><font color="#000000">timeout</font></b>()
<font color="#009900">Body</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>()
diff --git a/docs/en/gun/2.0/manual/gun.await_up/index.html b/docs/en/gun/2.0/manual/gun.await_up/index.html
index cd9d1e4b..c0927cef 100644
--- a/docs/en/gun/2.0/manual/gun.await_up/index.html
+++ b/docs/en/gun/2.0/manual/gun.await_up/index.html
@@ -118,7 +118,7 @@ http://www.gnu.org/software/src-highlite -->
{<font color="#FF6600">ok</font>, <font color="#990000">_</font>} <font color="#990000">=</font> <b><font color="#000000">gun:await_up</font></b>(<font color="#009900">ConnPid</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<h2 id="_see_also">See also</h2>
-<p><a href="../gun">gun(3)</a>, <a href="../gun.open">gun:open(3)</a>, <a href="../gun.open_unix">gun:open_unix(3)</a>, <a href="../gun_socks_up">gun_socks_up(3)</a>, <a href="../gun_up">gun_up(3)</a></p>
+<p><a href="../gun">gun(3)</a>, <a href="../gun.open">gun:open(3)</a>, <a href="../gun.open_unix">gun:open_unix(3)</a>, <a href="../gun_tunnel_up">gun_tunnel_up(3)</a>, <a href="../gun_up">gun_up(3)</a></p>
diff --git a/docs/en/gun/2.0/manual/gun.cancel/index.html b/docs/en/gun/2.0/manual/gun.cancel/index.html
index f4587e06..8876cfd5 100644
--- a/docs/en/gun/2.0/manual/gun.cancel/index.html
+++ b/docs/en/gun/2.0/manual/gun.cancel/index.html
@@ -72,7 +72,7 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">cancel</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>) <font color="#990000">-&gt;</font> <font color="#FF6600">ok</font>
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Cancel the given stream.</p>
<p>The behavior of this function depends on the protocol selected.</p>
diff --git a/docs/en/gun/2.0/manual/gun.connect/index.html b/docs/en/gun/2.0/manual/gun.connect/index.html
index a695950d..b75c855d 100644
--- a/docs/en/gun/2.0/manual/gun.connect/index.html
+++ b/docs/en/gun/2.0/manual/gun.connect/index.html
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#009900">Destination</font> <font color="#990000">::</font> <b><font color="#000000">gun:connect_destination</font></b>()
<font color="#009900">Headers</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_headers</font></b>()
<font color="#009900">ReqOpts</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_opts</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Establish a tunnel to the origin server.</p>
<p>This feature is currently only available for HTTP/1.1 connections. Upon successful completion of the CONNECT request a tunnel is established and subsequent requests will go through the tunnel.</p>
diff --git a/docs/en/gun/2.0/manual/gun.data/index.html b/docs/en/gun/2.0/manual/gun.data/index.html
index f37355fd..48e7a302 100644
--- a/docs/en/gun/2.0/manual/gun.data/index.html
+++ b/docs/en/gun/2.0/manual/gun.data/index.html
@@ -72,7 +72,7 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">data</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">IsFin</font>, <font color="#009900">Data</font>) <font color="#990000">-&gt;</font> <font color="#FF6600">ok</font>
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">IsFin</font> <font color="#990000">::</font> <font color="#FF6600">fin</font> | <font color="#FF6600">nofin</font>
<font color="#009900">Data</font> <font color="#990000">::</font> <b><font color="#000000">iodata</font></b>()</tt></pre>
</div></div>
diff --git a/docs/en/gun/2.0/manual/gun.delete/index.html b/docs/en/gun/2.0/manual/gun.delete/index.html
index a117d0d0..78854845 100644
--- a/docs/en/gun/2.0/manual/gun.delete/index.html
+++ b/docs/en/gun/2.0/manual/gun.delete/index.html
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
<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="#000000">gun:req_headers</font></b>()
<font color="#009900">ReqOpts</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_opts</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Delete a resource.</p>
<h2 id="_arguments">Arguments</h2>
diff --git a/docs/en/gun/2.0/manual/gun.flush/index.html b/docs/en/gun/2.0/manual/gun.flush/index.html
index 96659ce3..52d1ac59 100644
--- a/docs/en/gun/2.0/manual/gun.flush/index.html
+++ b/docs/en/gun/2.0/manual/gun.flush/index.html
@@ -73,7 +73,7 @@ http://www.gnu.org/software/src-highlite -->
<b><font color="#000000">flush</font></b>(<font color="#009900">StreamRef</font>) <font color="#990000">-&gt;</font> <font color="#FF6600">ok</font>
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Flush all messages related to a connection or a stream.</p>
<h2 id="_arguments">Arguments</h2>
diff --git a/docs/en/gun/2.0/manual/gun.get/index.html b/docs/en/gun/2.0/manual/gun.get/index.html
index 7119bd3c..b4d908d0 100644
--- a/docs/en/gun/2.0/manual/gun.get/index.html
+++ b/docs/en/gun/2.0/manual/gun.get/index.html
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
<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="#000000">gun:req_headers</font></b>()
<font color="#009900">ReqOpts</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_opts</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Get a resource representation.</p>
<h2 id="_arguments">Arguments</h2>
diff --git a/docs/en/gun/2.0/manual/gun.head/index.html b/docs/en/gun/2.0/manual/gun.head/index.html
index e3ef3ad5..a4e8ba11 100644
--- a/docs/en/gun/2.0/manual/gun.head/index.html
+++ b/docs/en/gun/2.0/manual/gun.head/index.html
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
<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="#000000">gun:req_headers</font></b>()
<font color="#009900">ReqOpts</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_opts</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Get headers of a resource representation.</p>
<p>This function performs the same operation as <a href="../gun.get">gun:get(3)</a>, except the server will not send the resource representation, only the response&apos;s status code and headers.</p>
diff --git a/docs/en/gun/2.0/manual/gun.headers/index.html b/docs/en/gun/2.0/manual/gun.headers/index.html
index 8f7c819b..c54b1f7d 100644
--- a/docs/en/gun/2.0/manual/gun.headers/index.html
+++ b/docs/en/gun/2.0/manual/gun.headers/index.html
@@ -80,7 +80,7 @@ http://www.gnu.org/software/src-highlite -->
<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="#000000">gun:req_headers</font></b>()
<font color="#009900">ReqOpts</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_opts</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Initiate the given request.</p>
<p>This is a general purpose function that should only be used when other method-specific functions do not apply.</p>
diff --git a/docs/en/gun/2.0/manual/gun.info/index.html b/docs/en/gun/2.0/manual/gun.info/index.html
index 6fbaaf8b..5d87f97a 100644
--- a/docs/en/gun/2.0/manual/gun.info/index.html
+++ b/docs/en/gun/2.0/manual/gun.info/index.html
@@ -79,6 +79,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#0000FF">protocol</font> <font color="#990000">=&gt;</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font> | <font color="#FF6600">ws</font>,
<font color="#0000FF">sock_ip</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:ip_address</font></b>(),
<font color="#0000FF">sock_port</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:port_number</font></b>(),
+ <font color="#0000FF">origin_scheme</font> <font color="#990000">=&gt;</font> <b><font color="#000080">binary</font></b>() | <font color="#000080">undefined</font>,
<font color="#0000FF">origin_host</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:hostname</font></b>() | <b><font color="#000000">inet:ip_address</font></b>(),
<font color="#0000FF">origin_port</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:port_number</font></b>(),
<font color="#0000FF">intermediaries</font> <font color="#990000">=&gt;</font> [<font color="#009900">Intermediary</font>],
@@ -89,7 +90,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#0000FF">host</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:hostname</font></b>() | <b><font color="#000000">inet:ip_address</font></b>(),
<font color="#0000FF">port</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:port_number</font></b>(),
<font color="#0000FF">transport</font> <font color="#990000">=&gt;</font> <font color="#FF6600">tcp</font> | <font color="#FF6600">tls</font>,
- <font color="#0000FF">protocol</font> <font color="#990000">=&gt;</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font>
+ <font color="#0000FF">protocol</font> <font color="#990000">=&gt;</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font> | <font color="#FF6600">raw</font>
}</tt></pre>
</div></div>
<p>Obtain information about the connection.</p>
@@ -101,7 +102,7 @@ http://www.gnu.org/software/src-highlite -->
<h2 id="_return_value">Return value</h2>
<p>A map is returned containing various informations about the connection.</p>
<h2 id="_changelog">Changelog</h2>
-<ul><li><strong>2.0</strong>: The values <code>owner</code> and <code>cookie_store</code> were added.
+<ul><li><strong>2.0</strong>: The values <code>owner</code>, <code>origin_scheme</code> and <code>cookie_store</code> were added.
</li>
<li><strong>1.3</strong>: The values <code>socket</code>, <code>transport</code>, <code>protocol</code>, <code>origin_host</code>, <code>origin_port</code> and <code>intermediaries</code> were added.
</li>
diff --git a/docs/en/gun/2.0/manual/gun.open/index.html b/docs/en/gun/2.0/manual/gun.open/index.html
index 97b90d3b..7253b733 100644
--- a/docs/en/gun/2.0/manual/gun.open/index.html
+++ b/docs/en/gun/2.0/manual/gun.open/index.html
@@ -122,7 +122,7 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt>{<font color="#FF6600">ok</font>, <font color="#009900">ConnPid</font>} <font color="#990000">=</font> <b><font color="#000000">gun:open</font></b>({<font color="#993399">127</font>,<font color="#993399">0</font>,<font color="#993399">0</font>,<font color="#993399">1</font>}, <font color="#993399">443</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<h2 id="_see_also">See also</h2>
-<p><a href="../gun">gun(3)</a>, <a href="../gun.open_unix">gun:open_unix(3)</a>, <a href="../gun.await_up">gun:await_up(3)</a>, <a href="../gun_socks_up">gun_socks_up(3)</a>, <a href="../gun_up">gun_up(3)</a></p>
+<p><a href="../gun">gun(3)</a>, <a href="../gun.open_unix">gun:open_unix(3)</a>, <a href="../gun.await_up">gun:await_up(3)</a>, <a href="../gun_tunnel_up">gun_tunnel_up(3)</a>, <a href="../gun_up">gun_up(3)</a></p>
diff --git a/docs/en/gun/2.0/manual/gun.open_unix/index.html b/docs/en/gun/2.0/manual/gun.open_unix/index.html
index 725ac5de..c681d915 100644
--- a/docs/en/gun/2.0/manual/gun.open_unix/index.html
+++ b/docs/en/gun/2.0/manual/gun.open_unix/index.html
@@ -110,7 +110,7 @@ http://www.gnu.org/software/src-highlite -->
#{<font color="#0000FF">protocols</font> <font color="#990000">=&gt;</font> [<font color="#FF6600">http2</font>]})<font color="#990000">.</font></tt></pre>
</div></div>
<h2 id="_see_also">See also</h2>
-<p><a href="../gun">gun(3)</a>, <a href="../gun.open">gun:open(3)</a>, <a href="../gun.await_up">gun:await_up(3)</a>, <a href="../gun_socks_up">gun_socks_up(3)</a>, <a href="../gun_up">gun_up(3)</a></p>
+<p><a href="../gun">gun(3)</a>, <a href="../gun.open">gun:open(3)</a>, <a href="../gun.await_up">gun:await_up(3)</a>, <a href="../gun_tunnel_up">gun_tunnel_up(3)</a>, <a href="../gun_up">gun_up(3)</a></p>
diff --git a/docs/en/gun/2.0/manual/gun.options/index.html b/docs/en/gun/2.0/manual/gun.options/index.html
index 2376b6da..64ff4350 100644
--- a/docs/en/gun/2.0/manual/gun.options/index.html
+++ b/docs/en/gun/2.0/manual/gun.options/index.html
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
<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="#000000">gun:req_headers</font></b>()
<font color="#009900">ReqOpts</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_opts</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Query the capabilities of the server or a resource.</p>
<p>The special path <code>&quot;*&quot;</code> can be used to obtain information about the server as a whole. Any other path will return information about that resource specifically.</p>
diff --git a/docs/en/gun/2.0/manual/gun.patch/index.html b/docs/en/gun/2.0/manual/gun.patch/index.html
index b35be5fa..bbb181e9 100644
--- a/docs/en/gun/2.0/manual/gun.patch/index.html
+++ b/docs/en/gun/2.0/manual/gun.patch/index.html
@@ -86,7 +86,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#009900">Headers</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_headers</font></b>()
<font color="#009900">Body</font> <font color="#990000">::</font> <b><font color="#000000">iodata</font></b>()
<font color="#009900">ReqOpts</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_opts</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Apply a set of changes to a resource.</p>
<p>The behavior of this function varies depending on whether a body is provided.</p>
diff --git a/docs/en/gun/2.0/manual/gun.post/index.html b/docs/en/gun/2.0/manual/gun.post/index.html
index 47c32880..382c9f1f 100644
--- a/docs/en/gun/2.0/manual/gun.post/index.html
+++ b/docs/en/gun/2.0/manual/gun.post/index.html
@@ -86,7 +86,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#009900">Headers</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_headers</font></b>()
<font color="#009900">Body</font> <font color="#990000">::</font> <b><font color="#000000">iodata</font></b>()
<font color="#009900">ReqOpts</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_opts</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Process the enclosed representation according to a resource&apos;s own semantics.</p>
<p>The behavior of this function varies depending on whether a body is provided.</p>
diff --git a/docs/en/gun/2.0/manual/gun.put/index.html b/docs/en/gun/2.0/manual/gun.put/index.html
index 2ec1ba7d..d6e160fc 100644
--- a/docs/en/gun/2.0/manual/gun.put/index.html
+++ b/docs/en/gun/2.0/manual/gun.put/index.html
@@ -86,7 +86,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#009900">Headers</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_headers</font></b>()
<font color="#009900">Body</font> <font color="#990000">::</font> <b><font color="#000000">iodata</font></b>()
<font color="#009900">ReqOpts</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_opts</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Create or replace a resource.</p>
<p>The behavior of this function varies depending on whether a body is provided.</p>
diff --git a/docs/en/gun/2.0/manual/gun.request/index.html b/docs/en/gun/2.0/manual/gun.request/index.html
index f4090fec..9b8de5ce 100644
--- a/docs/en/gun/2.0/manual/gun.request/index.html
+++ b/docs/en/gun/2.0/manual/gun.request/index.html
@@ -81,7 +81,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#009900">Headers</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_headers</font></b>()
<font color="#009900">Body</font> <font color="#990000">::</font> <b><font color="#000000">iodata</font></b>()
<font color="#009900">ReqOpts</font> <font color="#990000">::</font> <b><font color="#000000">gun:req_opts</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()</tt></pre>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Perform the given request.</p>
<p>This is a general purpose function that should only be used when other method-specific functions do not apply.</p>
diff --git a/docs/en/gun/2.0/manual/gun.stream_info/index.html b/docs/en/gun/2.0/manual/gun.stream_info/index.html
index 950ef659..7e2a43d7 100644
--- a/docs/en/gun/2.0/manual/gun.stream_info/index.html
+++ b/docs/en/gun/2.0/manual/gun.stream_info/index.html
@@ -72,11 +72,27 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">stream_info</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>) <font color="#990000">-&gt;</font> {<font color="#FF6600">ok</font>, <font color="#000080">undefined</font> | <font color="#009900">Info</font>} | {<font color="#FF6600">error</font>, <font color="#FF6600">not_connected</font>}
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">Info</font> <font color="#990000">::</font> #{
- <font color="#0000FF">ref</font> <font color="#990000">=&gt;</font> <b><font color="#000080">reference</font></b>(),
- <font color="#0000FF">reply_to</font> <font color="#990000">=&gt;</font> <b><font color="#000080">pid</font></b>(),
- <font color="#0000FF">state</font> <font color="#990000">=&gt;</font> <b><font color="#000080">running</font></b> | <font color="#FF6600">stopping</font>
+ <font color="#0000FF">ref</font> <font color="#990000">=&gt;</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#0000FF">reply_to</font> <font color="#990000">=&gt;</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#0000FF">state</font> <font color="#990000">=&gt;</font> <b><font color="#000080">running</font></b> | <font color="#FF6600">stopping</font>,
+ <font color="#0000FF">intermediaries</font> <font color="#990000">=&gt;</font> [<font color="#009900">Intermediary</font>],
+ <font color="#0000FF">tunnel</font> <font color="#990000">=&gt;</font> <font color="#009900">Tunnel</font>
+}
+<font color="#009900">Intermediary</font> <font color="#990000">::</font> #{
+ <font color="#0000FF">type</font> <font color="#990000">=&gt;</font> <font color="#FF6600">connect</font> | <font color="#FF6600">socks5</font>,
+ <font color="#0000FF">host</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:hostname</font></b>() | <b><font color="#000000">inet:ip_address</font></b>(),
+ <font color="#0000FF">port</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:port_number</font></b>(),
+ <font color="#0000FF">transport</font> <font color="#990000">=&gt;</font> <font color="#FF6600">tcp</font> | <font color="#FF6600">tls</font>,
+ <font color="#0000FF">protocol</font> <font color="#990000">=&gt;</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font> | <font color="#FF6600">raw</font>
+}
+<font color="#009900">Tunnel</font> <font color="#990000">::</font> #{
+ <font color="#0000FF">transport</font> <font color="#990000">=&gt;</font> <font color="#FF6600">tcp</font> | <font color="#FF6600">tls</font>,
+ <font color="#0000FF">protocol</font> <font color="#990000">=&gt;</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font> | <font color="#FF6600">raw</font>,
+ <font color="#0000FF">origin_scheme</font> <font color="#990000">=&gt;</font> <b><font color="#000080">binary</font></b>() | <font color="#000080">undefined</font>,
+ <font color="#0000FF">origin_host</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:hostname</font></b>() | <b><font color="#000000">inet:ip_address</font></b>(),
+ <font color="#0000FF">origin_port</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:port_number</font></b>()
}</tt></pre>
</div></div>
<p>Obtain information about a stream.</p>
diff --git a/docs/en/gun/2.0/manual/gun.update_flow/index.html b/docs/en/gun/2.0/manual/gun.update_flow/index.html
index 9c2a4126..55fc1806 100644
--- a/docs/en/gun/2.0/manual/gun.update_flow/index.html
+++ b/docs/en/gun/2.0/manual/gun.update_flow/index.html
@@ -72,7 +72,7 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">update_flow</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">Flow</font>) <font color="#990000">-&gt;</font> <font color="#FF6600">ok</font>
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">Flow</font> <font color="#990000">::</font> <b><font color="#000000">pos_integer</font></b>()</tt></pre>
</div></div>
<p>Update a stream&apos;s flow control value.</p>
diff --git a/docs/en/gun/2.0/manual/gun.ws_send/index.html b/docs/en/gun/2.0/manual/gun.ws_send/index.html
index f7318b1d..9761cf74 100644
--- a/docs/en/gun/2.0/manual/gun.ws_send/index.html
+++ b/docs/en/gun/2.0/manual/gun.ws_send/index.html
@@ -69,13 +69,14 @@
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><b><font color="#000000">ws_send</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">Frames</font>) <font color="#990000">-&gt;</font> <font color="#FF6600">ok</font>
-
-<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">Frames</font> <font color="#990000">::</font> <font color="#009900">Frame</font> | [<font color="#009900">Frame</font>]
-<font color="#009900">Frame</font> <font color="#990000">::</font> <font color="#FF6600">close</font> | <font color="#FF6600">ping</font> | <font color="#FF6600">pong</font>
- | {<font color="#FF6600">text</font> | <b><font color="#000080">binary</font></b> | <font color="#FF6600">close</font> | <font color="#FF6600">ping</font> | <font color="#FF6600">pong</font>, <b><font color="#000000">iodata</font></b>()}
- | {<font color="#FF6600">close</font>, <b><font color="#000000">non_neg_integer</font></b>(), <b><font color="#000000">iodata</font></b>()}</tt></pre>
+<pre><tt><b><font color="#000000">ws_send</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">Frames</font>) <font color="#990000">-&gt;</font> <font color="#FF6600">ok</font>
+
+<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
+<font color="#009900">Frames</font> <font color="#990000">::</font> <font color="#009900">Frame</font> | [<font color="#009900">Frame</font>]
+<font color="#009900">Frame</font> <font color="#990000">::</font> <font color="#FF6600">close</font> | <font color="#FF6600">ping</font> | <font color="#FF6600">pong</font>
+ | {<font color="#FF6600">text</font> | <b><font color="#000080">binary</font></b> | <font color="#FF6600">close</font> | <font color="#FF6600">ping</font> | <font color="#FF6600">pong</font>, <b><font color="#000000">iodata</font></b>()}
+ | {<font color="#FF6600">close</font>, <b><font color="#000000">non_neg_integer</font></b>(), <b><font color="#000000">iodata</font></b>()}</tt></pre>
</div></div>
<p>Send Websocket frames.</p>
<p>The connection must first be upgraded to Websocket using the function <a href="../gun.ws_upgrade">gun:ws_upgrade(3)</a>.</p>
@@ -83,6 +84,9 @@ http://www.gnu.org/software/src-highlite -->
<dl><dt>ConnPid</dt>
<dd><p>The pid of the Gun connection process.</p>
</dd>
+<dt>StreamRef</dt>
+<dd><p>Identifier of the stream that was upgraded to Websocket.</p>
+</dd>
<dt>Frames</dt>
<dd><p>One or more Websocket frame(s).</p>
</dd>
@@ -90,7 +94,11 @@ http://www.gnu.org/software/src-highlite -->
<h2 id="_return_value">Return value</h2>
<p>The atom <code>ok</code> is returned.</p>
<h2 id="_changelog">Changelog</h2>
-<ul><li><strong>1.0</strong>: Function introduced.
+<ul><li><strong>2.0</strong>: The mandatory <code>StreamRef</code> argument was added.
+</li>
+<li><strong>2.0</strong>: It is now possible to send multiple frames at once.
+</li>
+<li><strong>1.0</strong>: Function introduced.
</li>
</ul>
<h2 id="_examples">Examples</h2>
@@ -99,14 +107,14 @@ http://www.gnu.org/software/src-highlite -->
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><b><font color="#000000">gun:ws_send</font></b>(<font color="#009900">ConnPid</font>, {<font color="#FF6600">text</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"Hello world!"</font><font color="#990000">&gt;&gt;</font>})<font color="#990000">.</font></tt></pre>
+<pre><tt><b><font color="#000000">gun:ws_send</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, {<font color="#FF6600">text</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"Hello world!"</font><font color="#990000">&gt;&gt;</font>})<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">Send many frames including a close frame</div>
<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><b><font color="#000000">gun:ws_send</font></b>(<font color="#009900">ConnPid</font>, [
+<pre><tt><b><font color="#000000">gun:ws_send</font></b>(<font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, [
{<font color="#FF6600">text</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"See you later, world!"</font><font color="#990000">&gt;&gt;</font>},
<font color="#FF6600">close</font>
])<font color="#990000">.</font></tt></pre>
diff --git a/docs/en/gun/2.0/manual/gun.ws_upgrade/index.html b/docs/en/gun/2.0/manual/gun.ws_upgrade/index.html
index d3fc50d6..40fb7115 100644
--- a/docs/en/gun/2.0/manual/gun.ws_upgrade/index.html
+++ b/docs/en/gun/2.0/manual/gun.ws_upgrade/index.html
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
<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="#000000">gun:req_headers</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>
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()</tt></pre>
</div></div>
<p>Upgrade to Websocket.</p>
<p>The behavior of this function depends on the protocol selected.</p>
diff --git a/docs/en/gun/2.0/manual/gun/index.html b/docs/en/gun/2.0/manual/gun/index.html
index 2ee49896..7cf1858f 100644
--- a/docs/en/gun/2.0/manual/gun/index.html
+++ b/docs/en/gun/2.0/manual/gun/index.html
@@ -136,7 +136,7 @@
<p>Connection:</p>
<ul><li><a href="../gun_up">gun_up(3)</a> - The connection is up
</li>
-<li><a href="../gun_socks_up">gun_socks_up(3)</a> - The Socks connection is up
+<li><a href="../gun_tunnel_up">gun_tunnel_up(3)</a> - The tunnel is up
</li>
<li><a href="../gun_down">gun_down(3)</a> - The connection is down
</li>
@@ -210,11 +210,12 @@ by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">http_opts</font></b>() <font color="#990000">::</font> #{
- <font color="#0000FF">closing_timeout</font> <font color="#990000">=&gt;</font> <b><font color="#000000">timeout</font></b>(),
- <font color="#0000FF">flow</font> <font color="#990000">=&gt;</font> <b><font color="#000000">pos_integer</font></b>(),
- <font color="#0000FF">keepalive</font> <font color="#990000">=&gt;</font> <b><font color="#000000">timeout</font></b>(),
- <font color="#0000FF">transform_header_name</font> <font color="#990000">=&gt;</font> <b><font color="#0000FF">fun</font></b>((<b><font color="#000080">binary</font></b>()) <font color="#990000">-&gt;</font> <b><font color="#000080">binary</font></b>()),
- <font color="#0000FF">version</font> <font color="#990000">=&gt;</font> <font color="#FF6600">'HTTP/1.1'</font> | <font color="#FF6600">'HTTP/1.0'</font>
+ <font color="#0000FF">closing_timeout</font> <font color="#990000">=&gt;</font> <b><font color="#000000">timeout</font></b>(),
+ <font color="#0000FF">cookie_ignore_informational</font> <font color="#990000">=&gt;</font> <b><font color="#000000">boolean</font></b>(),
+ <font color="#0000FF">flow</font> <font color="#990000">=&gt;</font> <b><font color="#000000">pos_integer</font></b>(),
+ <font color="#0000FF">keepalive</font> <font color="#990000">=&gt;</font> <b><font color="#000000">timeout</font></b>(),
+ <font color="#0000FF">transform_header_name</font> <font color="#990000">=&gt;</font> <b><font color="#0000FF">fun</font></b>((<b><font color="#000080">binary</font></b>()) <font color="#990000">-&gt;</font> <b><font color="#000080">binary</font></b>()),
+ <font color="#0000FF">version</font> <font color="#990000">=&gt;</font> <font color="#FF6600">'HTTP/1.1'</font> | <font color="#FF6600">'HTTP/1.0'</font>
}</tt></pre>
</div></div>
<p>Configuration for the HTTP protocol.</p>
@@ -223,6 +224,9 @@ http://www.gnu.org/software/src-highlite -->
<dl><dt>closing_timeout (15000)</dt>
<dd><p>Time to wait before brutally closing the connection when a graceful shutdown was requested via a call to <a href="../gun.shutdown">gun:shutdown(3)</a>.</p>
</dd>
+<dt>cookie_ignore_informational (false)</dt>
+<dd><p>Whether cookies received inside informational responses (1xx status code) must be ignored.</p>
+</dd>
<dt>flow - see below</dt>
<dd><p>The initial flow control value for all HTTP/1.1 streams. By default flow control is disabled.</p>
</dd>
@@ -242,9 +246,10 @@ by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">http2_opts</font></b>() <font color="#990000">::</font> #{
- <font color="#0000FF">closing_timeout</font> <font color="#990000">=&gt;</font> <b><font color="#000000">timeout</font></b>(),
- <font color="#0000FF">flow</font> <font color="#990000">=&gt;</font> <b><font color="#000000">pos_integer</font></b>(),
- <font color="#0000FF">keepalive</font> <font color="#990000">=&gt;</font> <b><font color="#000000">timeout</font></b>(),
+ <font color="#0000FF">closing_timeout</font> <font color="#990000">=&gt;</font> <b><font color="#000000">timeout</font></b>(),
+ <font color="#0000FF">cookie_ignore_informational</font> <font color="#990000">=&gt;</font> <b><font color="#000000">boolean</font></b>(),
+ <font color="#0000FF">flow</font> <font color="#990000">=&gt;</font> <b><font color="#000000">pos_integer</font></b>(),
+ <font color="#0000FF">keepalive</font> <font color="#990000">=&gt;</font> <b><font color="#000000">timeout</font></b>(),
<i><font color="#9A1900">%% HTTP/2 state machine configuration.</font></i>
<font color="#0000FF">connection_window_margin_size</font> <font color="#990000">=&gt;</font> <font color="#993399">0</font><font color="#990000">..</font><font color="#993399">16#7fffffff</font>,
@@ -272,10 +277,13 @@ http://www.gnu.org/software/src-highlite -->
<dl><dt>closing_timeout (15000)</dt>
<dd><p>Time to wait before brutally closing the connection when a graceful shutdown was requested either via a call to <a href="../gun.shutdown">gun:shutdown(3)</a> or by the server.</p>
</dd>
+<dt>cookie_ignore_informational (false)</dt>
+<dd><p>Whether cookies received inside informational responses (1xx status code) must be ignored.</p>
+</dd>
<dt>flow - see below</dt>
<dd><p>The initial flow control value for all HTTP/2 streams. By default flow control is disabled.</p>
</dd>
-<dt>keepalive (5000)</dt>
+<dt>keepalive (infinity)</dt>
<dd><p>Time between pings in milliseconds.</p>
</dd>
</dl>
@@ -374,12 +382,25 @@ http://www.gnu.org/software/src-highlite -->
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><b><font color="#000000">protocols</font></b>() <font color="#990000">::</font> <font color="#FF6600">http</font> | {<font color="#FF6600">http</font>, <b><font color="#000000">http_opts</font></b>()}
- | <font color="#FF6600">http2</font> | {<font color="#FF6600">http2</font>, <b><font color="#000000">http2_opts</font></b>()}
- | <font color="#FF6600">socks</font> | {<font color="#FF6600">socks</font>, <b><font color="#000000">socks_opts</font></b>()}</tt></pre>
+<pre><tt><font color="#009900">Protocol</font> <font color="#990000">::</font> <font color="#FF6600">http</font> | {<font color="#FF6600">http</font>, <b><font color="#000000">http_opts</font></b>()}
+ | <font color="#FF6600">http2</font> | {<font color="#FF6600">http2</font>, <b><font color="#000000">http2_opts</font></b>()}
+ | <font color="#FF6600">raw</font> | {<font color="#FF6600">raw</font>, <b><font color="#000000">raw_opts</font></b>()}
+ | <font color="#FF6600">socks</font> | {<font color="#FF6600">socks</font>, <b><font color="#000000">socks_opts</font></b>()}
+
+<b><font color="#000000">protocols</font></b>() <font color="#990000">::</font> [<font color="#009900">Protocol</font>]</tt></pre>
</div></div>
<p>Ordered list of preferred protocols. When the transport is <code>tcp</code>, this list must contain exactly one protocol. When the transport is <code>tls</code>, this list must contain at least one protocol and will be used to negotiate a protocol via ALPN. When the server does not support ALPN then <code>http</code> will be used, except when the list of preferred protocols is set to only accept <code>socks</code>.</p>
<p>Defaults to <code>[http]</code> when the transport is <code>tcp</code>, and <code>[http2, http]</code> when the transport is <code>tls</code>.</p>
+<h3 id="_raw_opts">raw_opts()</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">raw_opts</font></b>() <font color="#990000">::</font> #{
+}</tt></pre>
+</div></div>
+<p>Configuration for the &quot;raw&quot; protocol.</p>
+<!-- The default value is given next to the option name:-->
<h3 id="_req_headers">req_headers()</h3>
<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
@@ -452,6 +473,15 @@ http://www.gnu.org/software/src-highlite -->
<dd><p>Version of the Socks protocol to use.</p>
</dd>
</dl>
+<h3 id="_stream_ref">stream_ref()</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">stream_ref</font></b>() <font color="#990000">-</font> <font color="#FF6600">see</font> <font color="#FF6600">below</font></tt></pre>
+</div></div>
+<p>Unique identifier for a stream.</p>
+<p>The exact type is considered to be an implementation detail.</p>
<h3 id="_ws_opts">ws_opts()</h3>
<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
@@ -477,7 +507,7 @@ http://www.gnu.org/software/src-highlite -->
<dt>flow - see below</dt>
<dd><p>The initial flow control value for the Websocket connection. By default flow control is disabled.</p>
</dd>
-<dt>keepalive (5000)</dt>
+<dt>keepalive (infinity)</dt>
<dd><p>Time between pings in milliseconds.</p>
</dd>
<dt>protocols ([])</dt>
@@ -489,7 +519,9 @@ http://www.gnu.org/software/src-highlite -->
</dl>
<!-- @todo Document default_protocol and user_opts.-->
<h2 id="_changelog">Changelog</h2>
-<ul><li><strong>2.0</strong>: The option <code>cookie_store</code> was added. It can be used to configure a cookie store that Gun will use automatically.
+<ul><li><strong>2.0</strong>: The <code>stream_ref()</code> type was added.
+</li>
+<li><strong>2.0</strong>: The option <code>cookie_store</code> was added. It can be used to configure a cookie store that Gun will use automatically. A related option, <code>cookie_ignore_informational</code>, was added to both <code>http_opts()</code> and <code>http2_opts()</code>.
</li>
<li><strong>2.0</strong>: The types <code>protocols()</code> and <code>socks_opts()</code> have been added. Support for the Socks protocol has been added in every places where protocol selection is available. In addition it is now possible to specify separate HTTP options for the CONNECT proxy and the origin server.
</li>
@@ -505,10 +537,12 @@ http://www.gnu.org/software/src-highlite -->
</li>
<li><strong>2.0</strong>: Function <code>gun:headers/4,5</code> introduced.
</li>
-<li><strong>2.0</strong>: The <code>keepalive</code> option is now set to <code>infinity</code> by default for the HTTP/1.1 protocol, disabling it.
+<li><strong>2.0</strong>: The <code>keepalive</code> option is now set to <code>infinity</code> by default for all protocols. This means it is disabled.
</li>
<li><strong>2.0</strong>: Websocket options <code>keepalive</code> and <code>silence_pings</code> introduced.
</li>
+<li><strong>2.0</strong>: Remove the <code>protocol</code> option from <code>connect_destination()</code>.
+</li>
<li><strong>1.3</strong>: Add the CONNECT destination&apos;s <code>protocols</code> option and deprecate the previously introduced <code>protocol</code> option.
</li>
<li><strong>1.2</strong>: Introduce the type <code>connect_destination()</code>.
diff --git a/docs/en/gun/2.0/manual/gun_app/index.html b/docs/en/gun/2.0/manual/gun_app/index.html
index 128f9228..70f44278 100644
--- a/docs/en/gun/2.0/manual/gun_app/index.html
+++ b/docs/en/gun/2.0/manual/gun_app/index.html
@@ -74,6 +74,8 @@
</li>
<li><a href="../gun_cookies_list">gun_cookies_list(3)</a> - Cookie store backend: in-memory, per connection
</li>
+<li><a href="../gun_event">gun_event(3)</a> - Events
+</li>
</ul>
<h2 id="_dependencies">Dependencies</h2>
<ul><li><a href="../cowlib">cowlib(7)</a> - Support library for manipulating Web protocols
diff --git a/docs/en/gun/2.0/manual/gun_data/index.html b/docs/en/gun/2.0/manual/gun_data/index.html
index a6b86b6b..080f442c 100644
--- a/docs/en/gun/2.0/manual/gun_data/index.html
+++ b/docs/en/gun/2.0/manual/gun_data/index.html
@@ -72,7 +72,7 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt>{<font color="#FF6600">gun_data</font>, <font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">IsFin</font>, <font color="#009900">Data</font>}
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">IsFin</font> <font color="#990000">::</font> <font color="#FF6600">fin</font> | <font color="#FF6600">nofin</font>
<font color="#009900">Data</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>()</tt></pre>
</div></div>
diff --git a/docs/en/gun/2.0/manual/gun_down/index.html b/docs/en/gun/2.0/manual/gun_down/index.html
index 19aaddac..45a715df 100644
--- a/docs/en/gun/2.0/manual/gun_down/index.html
+++ b/docs/en/gun/2.0/manual/gun_down/index.html
@@ -74,7 +74,7 @@ http://www.gnu.org/software/src-highlite -->
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
<font color="#009900">Protocol</font> <font color="#990000">::</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font> | <font color="#FF6600">ws</font>
<font color="#009900">Reason</font> <font color="#990000">::</font> <b><font color="#000000">any</font></b>()
-<font color="#009900">KilledStreams</font> <font color="#990000">::</font> [<b><font color="#000080">reference</font></b>()]</tt></pre>
+<font color="#009900">KilledStreams</font> <font color="#990000">::</font> [<b><font color="#000000">gun:stream_ref</font></b>()]</tt></pre>
</div></div>
<p>The connection is down.</p>
<p>This message informs the owner process that the connection was lost. Depending on the <code>retry</code> and <code>retry_timeout</code> options Gun may automatically attempt to reconnect.</p>
@@ -113,7 +113,7 @@ http://www.gnu.org/software/src-highlite -->
{<font color="#FF6600">noreply</font>, <font color="#009900">State</font>}<font color="#990000">.</font></tt></pre>
</div></div>
<h2 id="_see_also">See also</h2>
-<p><a href="../gun">gun(3)</a>, <a href="../gun.open">gun:open(3)</a>, <a href="../gun.open_unix">gun:open_unix(3)</a>, <a href="../gun_up">gun_up(3)</a>, <a href="../gun_socks_up">gun_socks_up(3)</a>, <a href="../gun_error">gun_error(3)</a></p>
+<p><a href="../gun">gun(3)</a>, <a href="../gun.open">gun:open(3)</a>, <a href="../gun.open_unix">gun:open_unix(3)</a>, <a href="../gun_up">gun_up(3)</a>, <a href="../gun_tunnel_up">gun_tunnel_up(3)</a>, <a href="../gun_error">gun_error(3)</a></p>
diff --git a/docs/en/gun/2.0/manual/gun_error/index.html b/docs/en/gun/2.0/manual/gun_error/index.html
index f58af877..e0056f64 100644
--- a/docs/en/gun/2.0/manual/gun_error/index.html
+++ b/docs/en/gun/2.0/manual/gun_error/index.html
@@ -73,7 +73,7 @@ http://www.gnu.org/software/src-highlite -->
{<font color="#FF6600">gun_error</font>, <font color="#009900">ConnPid</font>, <font color="#009900">Reason</font>}
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">Reason</font> <font color="#990000">::</font> <b><font color="#000000">any</font></b>()</tt></pre>
</div></div>
<p>Stream or connection-wide error.</p>
@@ -110,7 +110,7 @@ http://www.gnu.org/software/src-highlite -->
{<font color="#FF6600">noreply</font>, <font color="#009900">State</font>}<font color="#990000">.</font></tt></pre>
</div></div>
<h2 id="_see_also">See also</h2>
-<p><a href="../gun">gun(3)</a>, <a href="../gun_up">gun_up(3)</a>, <a href="../gun_socks_up">gun_socks_up(3)</a>, <a href="../gun_down">gun_down(3)</a></p>
+<p><a href="../gun">gun(3)</a>, <a href="../gun_up">gun_up(3)</a>, <a href="../gun_tunnel_up">gun_tunnel_up(3)</a>, <a href="../gun_down">gun_down(3)</a></p>
diff --git a/docs/en/gun/2.0/manual/gun_event/index.html b/docs/en/gun/2.0/manual/gun_event/index.html
new file mode 100644
index 00000000..1f6373c3
--- /dev/null
+++ b/docs/en/gun/2.0/manual/gun_event/index.html
@@ -0,0 +1,573 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <title>Nine Nines: gun_event(3)</title>
+
+ <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+ <link href="/css/99s.css?r=7" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>gun_event(3)</span></h1>
+
+<h2 id="_name">Name</h2>
+<p>gun_event - Events</p>
+<h2 id="_description">Description</h2>
+<p>The <code>gun_event</code> module provides the callback interface and types for implementing event handlers.</p>
+<h2 id="_callbacks">Callbacks</h2>
+<p>Event handlers implement the following interface. Because types are tied to specific events, they are documented alongside them. All event types are exported and can be referred to as <code>gun_event:Type()</code>.</p>
+<p>The events are ordered by the order they are likely to be triggered, with the most frequent events listed first.</p>
+<h3 id="_init">init</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">init_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">owner</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">transport</font> <font color="#990000">:=</font> <font color="#FF6600">tcp</font> | <font color="#FF6600">tls</font>,
+ <font color="#FF6600">origin_scheme</font> <font color="#990000">:=</font> <b><font color="#000080">binary</font></b>(),
+ <font color="#FF6600">origin_host</font> <font color="#990000">:=</font> <b><font color="#000000">inet:hostname</font></b>() | <b><font color="#000000">inet:ip_address</font></b>(),
+ <font color="#FF6600">origin_port</font> <font color="#990000">:=</font> <b><font color="#000000">inet:port_number</font></b>(),
+ <font color="#FF6600">opts</font> <font color="#990000">:=</font> <b><font color="#000000">gun:opts</font></b>()
+}
+
+<b><font color="#000000">init</font></b>(<b><font color="#000000">init_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun is initializing.</p>
+<h3 id="_domain_lookup_start">domain_lookup_start</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">domain_lookup_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">host</font> <font color="#990000">:=</font> <b><font color="#000000">inet:hostname</font></b>() | <b><font color="#000000">inet:ip_address</font></b>(),
+ <font color="#FF6600">port</font> <font color="#990000">:=</font> <b><font color="#000000">inet:port_number</font></b>(),
+ <font color="#FF6600">tcp_opts</font> <font color="#990000">:=</font> [<b><font color="#000000">gen_tcp:connect_option</font></b>()],
+ <font color="#FF6600">timeout</font> <font color="#990000">:=</font> <b><font color="#000000">timeout</font></b>(),
+ <font color="#0000FF">lookup_info</font> <font color="#990000">=&gt;</font> <b><font color="#000000">gun_tcp:lookup_info</font></b>(),
+ <font color="#0000FF">error</font> <font color="#990000">=&gt;</font> <b><font color="#000000">any</font></b>()
+}
+
+<b><font color="#000000">domain_lookup_start</font></b>(<b><font color="#000000">domain_lookup_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun is starting to resolve the host address.</p>
+<p>The <code>lookup_info</code> and <code>error</code> keys are never set for this event.</p>
+<h3 id="_domain_lookup_end">domain_lookup_end</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">domain_lookup_end</font></b>(<b><font color="#000000">domain_lookup_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has finished resolving the host address.</p>
+<p>The <code>lookup_info</code> key is only set when the lookup is successful. The <code>error</code> key is set otherwise.</p>
+<h3 id="_connect_start">connect_start</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">connect_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">lookup_info</font> <font color="#990000">:=</font> <b><font color="#000000">gun_tcp:lookup_info</font></b>(),
+ <font color="#FF6600">timeout</font> <font color="#990000">:=</font> <b><font color="#000000">timeout</font></b>(),
+ <font color="#0000FF">socket</font> <font color="#990000">=&gt;</font> <b><font color="#000000">inet:socket</font></b>(),
+ <font color="#0000FF">protocol</font> <font color="#990000">=&gt;</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font> | <font color="#FF6600">raw</font>,
+ <font color="#0000FF">error</font> <font color="#990000">=&gt;</font> <b><font color="#000000">any</font></b>()
+}
+
+<b><font color="#000000">connect_start</font></b>(<b><font color="#000000">connect_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun is starting to connect to the host address and port.</p>
+<p>The <code>socket</code>, <code>protocol</code> and <code>error</code> keys are never set for this event.</p>
+<h3 id="_connect_end">connect_end</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">connect_end</font></b>(<b><font color="#000000">connect_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has finished connecting to the host address and port.</p>
+<p>The <code>socket</code> key is set on connect success. The <code>error</code> key is set otherwise.</p>
+<p>The <code>protocol</code> key is only set when the transport is <code>tcp</code> and the connection is successful. The protocol is only known in the <code>tls_handshake_end</code> event otherwise.</p>
+<h3 id="_tls_handshake_start">tls_handshake_start</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">tls_handshake_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#0000FF">stream_ref</font> <font color="#990000">=&gt;</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#0000FF">reply_to</font> <font color="#990000">=&gt;</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">socket</font> <font color="#990000">:=</font> <b><font color="#000000">inet:socket</font></b>() | <b><font color="#000000">ssl:sslsocket</font></b>() | <b><font color="#000080">pid</font></b>(), <i><font color="#9A1900">%% The socket before/after will be different.</font></i>
+ <font color="#FF6600">tls_opts</font> <font color="#990000">:=</font> [<b><font color="#000000">ssl:tls_client_option</font></b>()],
+ <font color="#FF6600">timeout</font> <font color="#990000">:=</font> <b><font color="#000000">timeout</font></b>(),
+ <font color="#0000FF">protocol</font> <font color="#990000">=&gt;</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font> | <font color="#FF6600">raw</font>,
+ <font color="#0000FF">error</font> <font color="#990000">=&gt;</font> <b><font color="#000000">any</font></b>()
+}
+
+<b><font color="#000000">tls_handshake_start</font></b>(<b><font color="#000000">tls_handshake_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has started a TLS handshake.</p>
+<p>This and the <code>tls_handshake_end</code> event only occur when connecting to a TLS server or when upgrading the connection or a stream to use TLS, for example when using CONNECT or when connecting to a secure SOCKS server.</p>
+<p>The <code>stream_ref</code> and <code>reply_to</code> keys are only set when the TLS handshake occurs as a result of a CONNECT request or inside an existing CONNECT tunnel.</p>
+<p>The <code>protocol</code> and <code>error</code> keys are never set for this event.</p>
+<h3 id="_tls_handshake_end">tls_handshake_end</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">tls_handshake_end</font></b>(<b><font color="#000000">tls_handshake_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has finished a TLS handshake.</p>
+<p>The <code>protocol</code> key is set on TLS handshake success. The <code>error</code> key is set otherwise.</p>
+<h3 id="_request_start">request_start</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">request_start_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">function</font> <font color="#990000">:=</font> <font color="#FF6600">headers</font> | <font color="#FF6600">request</font> | <font color="#FF6600">ws_upgrade</font> | <font color="#FF6600">connect</font>,
+ <font color="#FF6600">method</font> <font color="#990000">:=</font> <b><font color="#000000">iodata</font></b>(),
+ <font color="#0000FF">scheme</font> <font color="#990000">=&gt;</font> <b><font color="#000080">binary</font></b>(),
+ <font color="#FF6600">authority</font> <font color="#990000">:=</font> <b><font color="#000000">iodata</font></b>(),
+ <font color="#0000FF">path</font> <font color="#990000">=&gt;</font> <b><font color="#000000">iodata</font></b>(),
+ <font color="#FF6600">headers</font> <font color="#990000">:=</font> [{<b><font color="#000080">binary</font></b>(), <b><font color="#000000">iodata</font></b>()}]
+}
+
+<b><font color="#000000">request_start</font></b>(<b><font color="#000000">request_start_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun is starting to send a request.</p>
+<p>The <code>scheme</code> and <code>path</code> keys are never set when the <code>function</code> is set to <code>connect</code>.</p>
+<h3 id="_request_headers">request_headers</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">request_headers</font></b>(<b><font color="#000000">request_start_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has finished sending the request headers.</p>
+<h3 id="_request_end">request_end</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">request_end_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>()
+}
+
+<b><font color="#000000">request_end</font></b>(<b><font color="#000000">request_end_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has finished sending the request.</p>
+<h3 id="_push_promise_start">push_promise_start</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">push_promise_start_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>()
+}
+
+<b><font color="#000000">push_promise_start</font></b>(<b><font color="#000000">push_promise_start_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has begun receiving a promised request (server push).</p>
+<h3 id="_push_promise_end">push_promise_end</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">push_promise_end_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#0000FF">promised_stream_ref</font> <font color="#990000">=&gt;</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">method</font> <font color="#990000">:=</font> <b><font color="#000080">binary</font></b>(),
+ <font color="#FF6600">uri</font> <font color="#990000">:=</font> <b><font color="#000080">binary</font></b>(),
+ <font color="#FF6600">headers</font> <font color="#990000">:=</font> [{<b><font color="#000080">binary</font></b>(), <b><font color="#000000">iodata</font></b>()}]
+}
+
+<b><font color="#000000">push_promise_end</font></b>(<b><font color="#000000">push_promise_end_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has finished receiving a promised request (server push). Promised requests never include a body.</p>
+<p>Promised requests received during the graceful shutdown of the connection get canceled immediately.</p>
+<!-- @todo The cancel event should probably trigger as well.-->
+<h3 id="_response_start">response_start</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">response_start_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>()
+}
+
+<b><font color="#000000">response_start</font></b>(<b><font color="#000000">response_start_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has begun receiving a response.</p>
+<h3 id="_response_inform">response_inform</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">response_headers_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">status</font> <font color="#990000">:=</font> <b><font color="#000000">non_neg_integer</font></b>(),
+ <font color="#FF6600">headers</font> <font color="#990000">:=</font> [{<b><font color="#000080">binary</font></b>(), <b><font color="#000080">binary</font></b>()}]
+}
+
+<b><font color="#000000">response_inform</font></b>(<b><font color="#000000">response_headers_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has received an informational response (1xx status code).</p>
+<p>A <code>status</code> with value 101 indicates that the response has concluded as the stream will be upgraded to a new protocol.</p>
+<h3 id="_response_headers">response_headers</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">response_headers</font></b>(<b><font color="#000000">response_headers_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has finished receiving response headers.</p>
+<h3 id="_response_trailers">response_trailers</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">response_trailers_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">headers</font> <font color="#990000">:=</font> [{<b><font color="#000080">binary</font></b>(), <b><font color="#000080">binary</font></b>()}]
+}
+
+<b><font color="#000000">response_trailers</font></b>(<b><font color="#000000">response_trailers_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has received response trailers.</p>
+<h3 id="_response_end">response_end</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">response_end_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>()
+}
+
+<b><font color="#000000">response_end</font></b>(<b><font color="#000000">response_end_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has finished receiving a response.</p>
+<h3 id="_ws_upgrade">ws_upgrade</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">ws_upgrade_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">opts</font> <font color="#990000">:=</font> <b><font color="#000000">gun:ws_opts</font></b>()
+}
+
+<b><font color="#000000">ws_upgrade</font></b>(<b><font color="#000000">ws_upgrade_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>A Websocket upgrade was requested.</p>
+<p>Success is indicated by a response (101 informational if HTTP/1.1, 2xx if HTTP/2) followed by a <code>protocol_changed</code> event.</p>
+<h3 id="_ws_recv_frame_start">ws_recv_frame_start</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">ws_recv_frame_start_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">frag_state</font> <font color="#990000">:=</font> <b><font color="#000000">cow_ws:frag_state</font></b>(),
+ <font color="#FF6600">extensions</font> <font color="#990000">:=</font> <b><font color="#000000">cow_ws:extensions</font></b>()
+}
+
+<b><font color="#000000">ws_recv_frame_start</font></b>(<b><font color="#000000">ws_recv_frame_start_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has begun receiving a Websocket frame.</p>
+<h3 id="_ws_recv_frame_header">ws_recv_frame_header</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">ws_recv_frame_header_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">frag_state</font> <font color="#990000">:=</font> <b><font color="#000000">cow_ws:frag_state</font></b>(),
+ <font color="#FF6600">extensions</font> <font color="#990000">:=</font> <b><font color="#000000">cow_ws:extensions</font></b>(),
+ <font color="#FF6600">type</font> <font color="#990000">:=</font> <b><font color="#000000">cow_ws:frame_type</font></b>(),
+ <font color="#FF6600">rsv</font> <font color="#990000">:=</font> <b><font color="#000000">cow_ws:rsv</font></b>(),
+ <font color="#FF6600">len</font> <font color="#990000">:=</font> <b><font color="#000000">non_neg_integer</font></b>(),
+ <font color="#FF6600">mask_key</font> <font color="#990000">:=</font> <b><font color="#000000">cow_ws:mask_key</font></b>()
+}
+
+<b><font color="#000000">ws_recv_frame_header</font></b>(<b><font color="#000000">ws_recv_frame_header_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has received the header part of a Websocket frame.</p>
+<p>It will be immediately be followed by the frame&apos;s payload.</p>
+<h3 id="_ws_recv_frame_end">ws_recv_frame_end</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">ws_recv_frame_end_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">extensions</font> <font color="#990000">:=</font> <b><font color="#000000">cow_ws:extensions</font></b>(),
+ <font color="#FF6600">close_code</font> <font color="#990000">:=</font> <font color="#000080">undefined</font> | <b><font color="#000000">cow_ws:close_code</font></b>(),
+ <font color="#FF6600">payload</font> <font color="#990000">:=</font> <b><font color="#000080">binary</font></b>()
+}
+
+<b><font color="#000000">ws_recv_frame_end</font></b>(<b><font color="#000000">ws_recv_frame_end_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has finished receiving a Websocket frame.</p>
+<h3 id="_ws_send_frame_start">ws_send_frame_start</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">ws_send_frame_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">extensions</font> <font color="#990000">:=</font> <b><font color="#000000">cow_ws:extensions</font></b>(),
+ <font color="#FF6600">frame</font> <font color="#990000">:=</font> <b><font color="#000000">gun:ws_frame</font></b>()
+}
+
+<b><font color="#000000">ws_send_frame_start</font></b>(<b><font color="#000000">ws_send_frame_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has started sending a Websocket frame.</p>
+<h3 id="_ws_send_frame_end">ws_send_frame_end</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">ws_send_frame_end</font></b>(<b><font color="#000000">ws_send_frame_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has finished sending a Websocket frame.</p>
+<h3 id="_protocol_changed">protocol_changed</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">protocol_changed_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">protocol</font> <font color="#990000">:=</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font> | <font color="#FF6600">raw</font> | <font color="#FF6600">ws</font>
+}
+
+<b><font color="#000000">protocol_changed</font></b>(<b><font color="#000000">protocol_changed_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>The protocol has changed for either the entire Gun connection or for a specific stream.</p>
+<p>The <code>stream_ref</code> key is only set when the protocol has changed for a specific stream or inside a CONNECT tunnel.</p>
+<p>This event occurs during successful Websocket upgrades, as a result of successful CONNECT requests or after a SOCKS tunnel was successfully established.</p>
+<h3 id="_origin_changed">origin_changed</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">origin_changed_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#0000FF">stream_ref</font> <font color="#990000">=&gt;</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">type</font> <font color="#990000">:=</font> <font color="#FF6600">connect</font> | <font color="#FF6600">socks5</font>,
+ <font color="#FF6600">origin_scheme</font> <font color="#990000">:=</font> <b><font color="#000080">binary</font></b>(),
+ <font color="#FF6600">origin_host</font> <font color="#990000">:=</font> <b><font color="#000000">inet:hostname</font></b>() | <b><font color="#000000">inet:ip_address</font></b>(),
+ <font color="#FF6600">origin_port</font> <font color="#990000">:=</font> <b><font color="#000000">inet:port_number</font></b>()
+}
+
+<b><font color="#000000">origin_changed</font></b>(<b><font color="#000000">origin_changed_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>The origin server has changed for either the Gun connection or for a specific stream.</p>
+<p>The <code>stream_ref</code> key is only set when the origin has changed for a specific stream or inside a CONNECT tunnel.</p>
+<h3 id="_cancel">cancel</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">cancel_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">stream_ref</font> <font color="#990000">:=</font> <b><font color="#000000">gun:stream_ref</font></b>(),
+ <font color="#FF6600">reply_to</font> <font color="#990000">:=</font> <b><font color="#000080">pid</font></b>(),
+ <font color="#FF6600">endpoint</font> <font color="#990000">:=</font> <font color="#FF6600">local</font> | <font color="#FF6600">remote</font>,
+ <font color="#FF6600">reason</font> <font color="#990000">:=</font> <b><font color="#000080">atom</font></b>()
+}
+
+<b><font color="#000000">cancel</font></b>(<b><font color="#000000">cancel_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>A stream has been canceled.</p>
+<p>HTTP/1.1 streams can&apos;t be canceled at the protocol level. In this case Gun will silence the stream for the user but events may still occur.</p>
+<p>HTTP/2 streams can be canceled both by the client and the server. Events may still occur for a short time after the stream has been canceled.</p>
+<h3 id="_disconnect">disconnect</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">disconnect_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">reason</font> <font color="#990000">:=</font> <b><font color="#000080">normal</font></b> | <font color="#FF6600">closed</font> | {<font color="#FF6600">error</font>, <b><font color="#000000">any</font></b>()}
+}
+
+<b><font color="#000000">disconnect</font></b>(<b><font color="#000000">disconnect_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun has been disconnected from the server.</p>
+<h3 id="_terminate">terminate</h3>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><b><font color="#000000">terminate_event</font></b>() <font color="#990000">::</font> #{
+ <font color="#FF6600">state</font> <font color="#990000">:=</font> <font color="#FF6600">not_connected</font>
+ | <font color="#FF6600">domain_lookup</font> | <font color="#FF6600">connecting</font> | <font color="#FF6600">initial_tls_handshake</font> | <font color="#FF6600">tls_handshake</font>
+ | <font color="#FF6600">connected</font> | <font color="#FF6600">connected_data_only</font> | <font color="#FF6600">connected_ws_only</font>,
+ <font color="#FF6600">reason</font> <font color="#990000">:=</font> <b><font color="#000080">normal</font></b> | <font color="#000080">shutdown</font> | {<font color="#000080">shutdown</font>, <b><font color="#000000">any</font></b>()} | <b><font color="#000000">any</font></b>()
+}
+
+<b><font color="#000000">terminate</font></b>(<b><font color="#000000">terminate_event</font></b>(), <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#009900">State</font></tt></pre>
+</div></div>
+<p>Gun is terminating.</p>
+<h2 id="_changelog">Changelog</h2>
+<ul><li><strong>2.0</strong>: Module introduced.
+</li>
+</ul>
+<h2 id="_see_also">See also</h2>
+<p><a href="..">gun(7)</a>, <a href="../gun">gun(3)</a></p>
+
+
+
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Gun
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/gun/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/gun/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/gun/2.0/manual">2.0</a></li>
+
+ <li><a href="/docs/en/gun/1.3/manual">1.3</a></li>
+
+ <li><a href="/docs/en/gun/1.2/manual">1.2</a></li>
+
+ <li><a href="/docs/en/gun/1.1/manual">1.1</a></li>
+
+ <li><a href="/docs/en/gun/1.0/manual">1.0</a></li>
+
+</ul>
+
+<h3 id="_like_my_work__donate">Like my work? Donate!</h3>
+<p>Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:</p>
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="display:inline">
+<input type="hidden" name="cmd" value="_donations">
+<input type="hidden" name="business" value="[email protected]">
+<input type="hidden" name="lc" value="FR">
+<input type="hidden" name="item_name" value="Loic Hoguin">
+<input type="hidden" name="item_number" value="99s">
+<input type="hidden" name="currency_code" value="EUR">
+<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHosted">
+<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
+<img alt="" border="0" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
+</form><p>Recurring payment options are also available via <a href="https://github.com/sponsors/essen">GitHub Sponsors</a>. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.</p>
+
+
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2018</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/gun/2.0/manual/gun_inform/index.html b/docs/en/gun/2.0/manual/gun_inform/index.html
index b5207ec6..655ce50d 100644
--- a/docs/en/gun/2.0/manual/gun_inform/index.html
+++ b/docs/en/gun/2.0/manual/gun_inform/index.html
@@ -72,7 +72,7 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt>{<font color="#FF6600">gun_inform</font>, <font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">Status</font>, <font color="#009900">Headers</font>}
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">Status</font> <font color="#990000">::</font> <font color="#993399">100</font><font color="#990000">..</font><font color="#993399">199</font>
<font color="#009900">Headers</font> <font color="#990000">::</font> [{<b><font color="#000080">binary</font></b>(), <b><font color="#000080">binary</font></b>()}]</tt></pre>
</div></div>
diff --git a/docs/en/gun/2.0/manual/gun_push/index.html b/docs/en/gun/2.0/manual/gun_push/index.html
index 383f6c04..3a1bfd27 100644
--- a/docs/en/gun/2.0/manual/gun_push/index.html
+++ b/docs/en/gun/2.0/manual/gun_push/index.html
@@ -72,8 +72,8 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt>{<font color="#FF6600">gun_push</font>, <font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">NewStreamRef</font>, <font color="#009900">Method</font>, <font color="#009900">URI</font>, <font color="#009900">Headers</font>}
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
-<font color="#009900">NewStreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
+<font color="#009900">NewStreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">Method</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>()
<font color="#009900">URI</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>()
<font color="#009900">Headers</font> <font color="#990000">::</font> [{<b><font color="#000080">binary</font></b>(), <b><font color="#000080">binary</font></b>()}]</tt></pre>
diff --git a/docs/en/gun/2.0/manual/gun_response/index.html b/docs/en/gun/2.0/manual/gun_response/index.html
index 92083f34..c995e535 100644
--- a/docs/en/gun/2.0/manual/gun_response/index.html
+++ b/docs/en/gun/2.0/manual/gun_response/index.html
@@ -72,7 +72,7 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt>{<font color="#FF6600">gun_response</font>, <font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">IsFin</font>, <font color="#009900">Status</font>, <font color="#009900">Headers</font>}
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">IsFin</font> <font color="#990000">::</font> <font color="#FF6600">fin</font> | <font color="#FF6600">nofin</font>
<font color="#009900">Status</font> <font color="#990000">::</font> <b><font color="#000000">non_neg_integer</font></b>()
<font color="#009900">Headers</font> <font color="#990000">::</font> [{<b><font color="#000080">binary</font></b>(), <b><font color="#000080">binary</font></b>()}]</tt></pre>
diff --git a/docs/en/gun/2.0/manual/gun_trailers/index.html b/docs/en/gun/2.0/manual/gun_trailers/index.html
index ac9b7a60..45351e6a 100644
--- a/docs/en/gun/2.0/manual/gun_trailers/index.html
+++ b/docs/en/gun/2.0/manual/gun_trailers/index.html
@@ -72,7 +72,7 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt>{<font color="#FF6600">gun_trailers</font>, <font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">Headers</font>}
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">Headers</font> <font color="#990000">::</font> [{<b><font color="#000080">binary</font></b>(), <b><font color="#000080">binary</font></b>()}]</tt></pre>
</div></div>
<p>Response trailers.</p>
diff --git a/docs/en/gun/2.0/manual/gun_socks_up/index.html b/docs/en/gun/2.0/manual/gun_tunnel_up/index.html
index 2e008e8d..d68424cb 100644
--- a/docs/en/gun/2.0/manual/gun_socks_up/index.html
+++ b/docs/en/gun/2.0/manual/gun_tunnel_up/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">
- <title>Nine Nines: gun_socks_up(3)</title>
+ <title>Nine Nines: gun_tunnel_up(3)</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
<link href="/css/99s.css?r=7" rel="stylesheet">
@@ -60,28 +60,31 @@
<div class="row">
<div id="docs" class="span9 maincol">
-<h1 class="lined-header"><span>gun_socks_up(3)</span></h1>
+<h1 class="lined-header"><span>gun_tunnel_up(3)</span></h1>
<h2 id="_name">Name</h2>
-<p>gun_socks_up - The Socks connection is up</p>
+<p>gun_tunnel_up - The tunnel is up</p>
<h2 id="_description">Description</h2>
<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt>{<font color="#FF6600">gun_socks_up</font>, <font color="#009900">ConnPid</font>, <font color="#009900">Protocol</font>}
+<pre><tt>{<font color="#FF6600">gun_tunnel_up</font>, <font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">Protocol</font>}
-<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">Protocol</font> <font color="#990000">::</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font></tt></pre>
+<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>() | <font color="#000080">undefined</font>
+<font color="#009900">Protocol</font> <font color="#990000">::</font> <font color="#FF6600">http</font> | <font color="#FF6600">http2</font> | <font color="#FF6600">socks</font></tt></pre>
</div></div>
-<p>The Socks connection is up.</p>
-<p>This message informs the owner/calling process that the connection completed through the configured Socks proxy.</p>
-<p>If Gun is configured to connect to another Socks server, then the connection is not usable yet. One or more <a href="../gun_socks_up">gun_socks_up(3)</a> messages will follow.</p>
-<p>Otherwise, Gun will start processing the messages it received while waiting for the connection to be up. If this is a reconnection, then this may not be desirable for all requests. Those requests should be cancelled when the connection goes down, and any subsequent messages ignored.</p>
+<p>The tunnel is up.</p>
+<p>This message informs the owner/calling process that the connection completed through the SOCKS or CONNECT proxy.</p>
+<p>If Gun is configured to connect to another SOCKS server, then the connection is not usable yet. One or more <a href="../gun_tunnel_up">gun_tunnel_up(3)</a> messages will follow.</p>
<h2 id="_elements">Elements</h2>
<dl><dt>ConnPid</dt>
<dd><p>The pid of the Gun connection process.</p>
</dd>
+<dt>StreamRef</dt>
+<dd><p>The stream reference the tunnel is running on, or <code>undefined</code> if there are no underlying stream.</p>
+</dd>
<dt>Protocol</dt>
<dd><p>The protocol selected for this connection. It can be used to determine the capabilities of the server.</p>
</dd>
@@ -91,12 +94,12 @@ http://www.gnu.org/software/src-highlite -->
</li>
</ul>
<h2 id="_examples">Examples</h2>
-<div class="listingblock"><div class="title">Receive a gun_socks_up message in a gen_server</div>
+<div class="listingblock"><div class="title">Receive a gun_tunnel_up message in a gen_server</div>
<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><b><font color="#000000">handle_info</font></b>({<font color="#FF6600">gun_socks_up</font>, <font color="#009900">ConnPid</font>, <font color="#009900">_Protocol</font>},
+<pre><tt><b><font color="#000000">handle_info</font></b>({<font color="#FF6600">gun_tunnel_up</font>, <font color="#009900">ConnPid</font>, <font color="#009900">_StreamRef</font>, <font color="#009900">_Protocol</font>},
<font color="#009900">State</font><font color="#990000">=</font><font color="#008080">#state</font>{<font color="#0000FF">conn_pid</font><font color="#990000">=</font><font color="#009900">ConnPid</font>}) <font color="#990000">-&gt;</font>
<i><font color="#9A1900">%% Do something.</font></i>
{<font color="#FF6600">noreply</font>, <font color="#009900">State</font>}<font color="#990000">.</font></tt></pre>
diff --git a/docs/en/gun/2.0/manual/gun_up/index.html b/docs/en/gun/2.0/manual/gun_up/index.html
index 8628c89a..f06ada2a 100644
--- a/docs/en/gun/2.0/manual/gun_up/index.html
+++ b/docs/en/gun/2.0/manual/gun_up/index.html
@@ -76,7 +76,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>The connection is up.</p>
<p>This message informs the owner process that the connection or reconnection completed.</p>
-<p>If Gun is configured to connect to a Socks server, then the connection is not usable yet. One or more <a href="../gun_socks_up">gun_socks_up(3)</a> messages will follow.</p>
+<p>If Gun is configured to connect to a Socks server, then the connection is not usable yet. One or more <a href="../gun_tunnel_up">gun_tunnel_up(3)</a> messages will follow.</p>
<p>Otherwise, Gun will start processing the messages it received while waiting for the connection to be up. If this is a reconnection, then this may not be desirable for all requests. Those requests should be cancelled when the connection goes down, and any subsequent messages ignored.</p>
<h2 id="_elements">Elements</h2>
<dl><dt>ConnPid</dt>
@@ -102,7 +102,7 @@ http://www.gnu.org/software/src-highlite -->
{<font color="#FF6600">noreply</font>, <font color="#009900">State</font>}<font color="#990000">.</font></tt></pre>
</div></div>
<h2 id="_see_also">See also</h2>
-<p><a href="../gun">gun(3)</a>, <a href="../gun.open">gun:open(3)</a>, <a href="../gun.open_unix">gun:open_unix(3)</a>, <a href="../gun.await_up">gun:await_up(3)</a>, <a href="../gun_socks_up">gun_socks_up(3)</a>, <a href="../gun_down">gun_down(3)</a>, <a href="../gun_error">gun_error(3)</a></p>
+<p><a href="../gun">gun(3)</a>, <a href="../gun.open">gun:open(3)</a>, <a href="../gun.open_unix">gun:open_unix(3)</a>, <a href="../gun.await_up">gun:await_up(3)</a>, <a href="../gun_tunnel_up">gun_tunnel_up(3)</a>, <a href="../gun_down">gun_down(3)</a>, <a href="../gun_error">gun_error(3)</a></p>
diff --git a/docs/en/gun/2.0/manual/gun_upgrade/index.html b/docs/en/gun/2.0/manual/gun_upgrade/index.html
index f0eb8cf4..f5930c2f 100644
--- a/docs/en/gun/2.0/manual/gun_upgrade/index.html
+++ b/docs/en/gun/2.0/manual/gun_upgrade/index.html
@@ -72,7 +72,7 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt>{<font color="#FF6600">gun_upgrade</font>, <font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">Protocols</font>, <font color="#009900">Headers</font>}
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">Protocols</font> <font color="#990000">::</font> [<font color="#990000">&lt;&lt;</font><font color="#FF0000">"websocket"</font><font color="#990000">&gt;&gt;</font>]
<font color="#009900">Headers</font> <font color="#990000">::</font> [{<b><font color="#000080">binary</font></b>(), <b><font color="#000080">binary</font></b>()}]</tt></pre>
</div></div>
diff --git a/docs/en/gun/2.0/manual/gun_ws/index.html b/docs/en/gun/2.0/manual/gun_ws/index.html
index 1104813b..1bb62a49 100644
--- a/docs/en/gun/2.0/manual/gun_ws/index.html
+++ b/docs/en/gun/2.0/manual/gun_ws/index.html
@@ -72,7 +72,7 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt>{<font color="#FF6600">gun_ws</font>, <font color="#009900">ConnPid</font>, <font color="#009900">StreamRef</font>, <font color="#009900">Frame</font>}
<font color="#009900">ConnPid</font> <font color="#990000">::</font> <b><font color="#000080">pid</font></b>()
-<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000080">reference</font></b>()
+<font color="#009900">StreamRef</font> <font color="#990000">::</font> <b><font color="#000000">gun:stream_ref</font></b>()
<font color="#009900">Frame</font> <font color="#990000">::</font> <font color="#FF6600">close</font> | <font color="#FF6600">ping</font> | <font color="#FF6600">pong</font>
| {<font color="#FF6600">text</font> | <b><font color="#000080">binary</font></b> | <font color="#FF6600">close</font>, <b><font color="#000080">binary</font></b>()}
| {<font color="#FF6600">close</font>, <b><font color="#000000">non_neg_integer</font></b>(), <b><font color="#000080">binary</font></b>()}
diff --git a/docs/en/gun/2.0/manual/index.html b/docs/en/gun/2.0/manual/index.html
index 70ff07c7..3a4b3603 100644
--- a/docs/en/gun/2.0/manual/index.html
+++ b/docs/en/gun/2.0/manual/index.html
@@ -74,6 +74,8 @@
</li>
<li><a href="gun_cookies_list">gun_cookies_list(3)</a> - Cookie store backend: in-memory, per connection
</li>
+<li><a href="gun_event">gun_event(3)</a> - Events
+</li>
</ul>
<h2 id="_dependencies">Dependencies</h2>
<ul><li><a href="cowlib_app">cowlib(7)</a> - Support library for manipulating Web protocols