summaryrefslogtreecommitdiffstats
path: root/docs/en/gun/1.1/guide
diff options
context:
space:
mode:
Diffstat (limited to 'docs/en/gun/1.1/guide')
-rw-r--r--docs/en/gun/1.1/guide/connect/index.html12
-rw-r--r--docs/en/gun/1.1/guide/http/index.html42
-rw-r--r--docs/en/gun/1.1/guide/start/index.html10
-rw-r--r--docs/en/gun/1.1/guide/websocket/index.html10
4 files changed, 35 insertions, 39 deletions
diff --git a/docs/en/gun/1.1/guide/connect/index.html b/docs/en/gun/1.1/guide/connect/index.html
index 7aa168b1..8015a913 100644
--- a/docs/en/gun/1.1/guide/connect/index.html
+++ b/docs/en/gun/1.1/guide/connect/index.html
@@ -71,7 +71,7 @@
<h2 id="_opening_a_new_connection">Opening a new connection</h2>
<p>The <code>gun:open/2,3</code> function must be used to open a connection.</p>
<div class="listingblock"><div class="title">Opening a connection to example.org on port 443</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
<p>The transport and protocol used can be overriden via options. The manual documents all available options.</p>
<p>Options can be provided as a third argument, and take the form of a map.</p>
<div class="listingblock"><div class="title">Opening a TLS connection to example.org on port 8443</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -92,7 +92,7 @@ http://www.gnu.org/software/src-highlite -->
<p>When Gun successfully connects to the server, it sends a <code>gun_up</code> message with the protocol that has been selected for the connection.</p>
<p>Gun provides the functions <code>gun:await_up/1,2,3</code> that wait for the <code>gun_up</code> message. They can optionally take a monitor reference and/or timeout value. If no monitor is provided, one will be created for the duration of the function call.</p>
<div class="listingblock"><div class="title">Synchronous opening of a connection</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -107,7 +107,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Gun leaves you the choice as to which one will be used. However, if you use the <code>gun:await/2,3</code> or <code>gun:await_body/2,3</code> functions, a monitor may be used for you to avoid getting stuck waiting for a message that will never come.</p>
<p>If you choose to monitor yourself you can do it on a permanent basis rather than on every message you will receive, saving resources. Indeed, the <code>gun:await/3,4</code> and <code>gun:await_body/3,4</code> functions both accept a monitor argument if you have one already.</p>
<div class="listingblock"><div class="title">Monitoring the connection process</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -116,7 +116,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>This monitor reference can be kept and used until the connection process exits.</p>
<div class="listingblock"><div class="title">Handling `DOWN` messages</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -131,7 +131,7 @@ http://www.gnu.org/software/src-highlite -->
<h2 id="_closing_the_connection_abruptly">Closing the connection abruptly</h2>
<p>The connection can be stopped abruptly at any time by calling the <code>gun:close/1</code> function.</p>
<div class="listingblock"><div class="title">Immediate closing of the connection</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
diff --git a/docs/en/gun/1.1/guide/http/index.html b/docs/en/gun/1.1/guide/http/index.html
index 59cfb9a1..1c69ca27 100644
--- a/docs/en/gun/1.1/guide/http/index.html
+++ b/docs/en/gun/1.1/guide/http/index.html
@@ -69,7 +69,7 @@
<p>Streams can be canceled at any time. This will stop any further messages from being sent to the owner process. Depending on its capabilities, the server will also be instructed to cancel the request.</p>
<p>Canceling a stream may result in Gun dropping the connection temporarily, to avoid uploading or downloading data that will not be used.</p>
<div class="listingblock"><div class="title">Cancelling a stream</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -83,14 +83,14 @@ http://www.gnu.org/software/src-highlite -->
<h4 id="_get_and_head">GET and HEAD</h4>
<p>Use <code>gun:get/2,3,4</code> to request a resource.</p>
<div class="listingblock"><div class="title">GET &quot;/organizations/ninenines&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<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="#009900">StreamRef</font> <font color="#990000">=</font> <b><font color="#000000">gun:get</font></b>(<font color="#009900">ConnPid</font>, <font color="#FF0000">"/organizations/ninenines"</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">GET &quot;/organizations/ninenines&quot; with custom headers</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -102,14 +102,14 @@ http://www.gnu.org/software/src-highlite -->
<p>Note that the list of headers has the field name as a binary. The field value is iodata, which is either a binary or an iolist.</p>
<p>Use <code>gun:head/2,3,4</code> if you don&apos;t need the response body.</p>
<div class="listingblock"><div class="title">HEAD &quot;/organizations/ninenines&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<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="#009900">StreamRef</font> <font color="#990000">=</font> <b><font color="#000000">gun:head</font></b>(<font color="#009900">ConnPid</font>, <font color="#FF0000">"/organizations/ninenines"</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">HEAD &quot;/organizations/ninenines&quot; with custom headers</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -128,7 +128,7 @@ http://www.gnu.org/software/src-highlite -->
<p>The <code>gun:post/4,5</code>, <code>gun:put/4,5</code> and <code>gun:patch/4,5</code> functions take a body as their fourth argument. These functions do not require any body-specific header to be set, although it is always recommended to set the content-type header. Gun will set the other headers automatically.</p>
<p>In this and the following examples in this section, <code>gun:post</code> can be replaced by <code>gun:put</code> or <code>gun:patch</code> for performing a PUT or PATCH request, respectively.</p>
<div class="listingblock"><div class="title">POST &quot;/organizations/ninenines&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -140,7 +140,7 @@ http://www.gnu.org/software/src-highlite -->
<p>The <code>gun:post/3</code>, <code>gun:put/3</code> and <code>gun:patch/3</code> functions do not take a body in their arguments. If a body is to be provided later on, using the <code>gun:data/4</code> function, then the request headers must indicate this. This can be done by setting the content-length or content-type request headers. If these headers are not set then Gun will assume the request has no body.</p>
<p>It is recommended to send the content-length header if you know it in advance, although this is not required. If it is not set, HTTP/1.1 will use the chunked transfer-encoding, and HTTP/2 will continue normally as it is chunked by design.</p>
<div class="listingblock"><div class="title">POST &quot;/organizations/ninenines&quot; with delayed body</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -153,7 +153,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>The atom <code>fin</code> indicates this is the last chunk of data to be sent. You can call the <code>gun:data/4</code> function as many times as needed until you have sent the entire body. The last call must use <code>fin</code> and all the previous calls must use <code>nofin</code>. The last chunk may be empty.</p>
<div class="listingblock"><div class="title">Streaming the request body</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -174,14 +174,14 @@ http://www.gnu.org/software/src-highlite -->
<h4 id="_delete">DELETE</h4>
<p>Use <code>gun:delete/2,3,4</code> to delete a resource.</p>
<div class="listingblock"><div class="title">DELETE &quot;/organizations/ninenines&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<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="#009900">StreamRef</font> <font color="#990000">=</font> <b><font color="#000000">gun:delete</font></b>(<font color="#009900">ConnPid</font>, <font color="#FF0000">"/organizations/ninenines"</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">DELETE &quot;/organizations/ninenines&quot; with custom headers</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -192,14 +192,14 @@ http://www.gnu.org/software/src-highlite -->
<h4 id="_options">OPTIONS</h4>
<p>Use <code>gun:options/2,3</code> to request information about a resource.</p>
<div class="listingblock"><div class="title">OPTIONS &quot;/organizations/ninenines&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<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="#009900">StreamRef</font> <font color="#990000">=</font> <b><font color="#000000">gun:options</font></b>(<font color="#009900">ConnPid</font>, <font color="#FF0000">"/organizations/ninenines"</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">OPTIONS &quot;/organizations/ninenines&quot; with custom headers</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -209,7 +209,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>You can also use this function to request information about the server itself.</p>
<div class="listingblock"><div class="title">OPTIONS &quot;*&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -218,7 +218,7 @@ http://www.gnu.org/software/src-highlite -->
<h4 id="_requests_with_an_arbitrary_method">Requests with an arbitrary method</h4>
<p>The <code>gun:request/4,5,6</code> function can be used to send requests with a configurable method name. It is mostly useful when you need a method that Gun does not understand natively.</p>
<div class="listingblock"><div class="title">Example of a TRACE request</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -232,7 +232,7 @@ http://www.gnu.org/software/src-highlite -->
<p>When using HTTP/2 this value is sent with the frame and simply passed on in the message. When using HTTP/1.1 however Gun must guess whether data will follow by looking at the response headers.</p>
<p>You can receive messages directly, or you can use the <em>await</em> functions to let Gun receive them for you.</p>
<div class="listingblock"><div class="title">Receiving a response using receive</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -270,7 +270,7 @@ http://www.gnu.org/software/src-highlite -->
<p>When calling <code>gun:await/2,3</code> and not passing a monitor reference, one is automatically created for you for the duration of the call.</p>
<p>The <code>gun:await_body/2,3,4</code> works similarly, but returns the body received. Both functions can be combined to receive the response and its body sequentially.</p>
<div class="listingblock"><div class="title">Receiving a response using await</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -288,7 +288,7 @@ http://www.gnu.org/software/src-highlite -->
<p>You can safely choose to ignore <code>gun_push</code> messages, or you can handle them. If you do, you can either receive the messages directly or use <em>await</em> functions.</p>
<p>The <code>gun_push</code> message contains both the new stream reference and the stream reference of the original request.</p>
<div class="listingblock"><div class="title">Receiving a pushed response using receive</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -300,7 +300,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>If you use the <code>gun:await/2,3,4</code> function, however, Gun will use the original reference to identify the message but will return a tuple that doesn&apos;t contain it.</p>
<div class="listingblock"><div class="title">Receiving a pushed response using await</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -311,14 +311,14 @@ http://www.gnu.org/software/src-highlite -->
<h2 id="_flushing_unwanted_messages">Flushing unwanted messages</h2>
<p>Gun provides the function <code>gun:flush/1</code> to quickly get rid of unwanted messages sitting in the process mailbox. You can use it to get rid of all messages related to a connection, or just the messages related to a stream.</p>
<div class="listingblock"><div class="title">Flush all messages from a Gun connection</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<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:flush</font></b>(<font color="#009900">ConnPid</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">Flush all messages from a specific stream</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -327,7 +327,7 @@ http://www.gnu.org/software/src-highlite -->
<h2 id="_redirecting_responses_to_a_different_process">Redirecting responses to a different process</h2>
<p>Gun allows you to specify which process will handle responses to a request via the <code>reply_to</code> request option.</p>
<div class="listingblock"><div class="title">GET &quot;/organizations/ninenines&quot; to a different process</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
diff --git a/docs/en/gun/1.1/guide/start/index.html b/docs/en/gun/1.1/guide/start/index.html
index 4a7f7702..c6116d9b 100644
--- a/docs/en/gun/1.1/guide/start/index.html
+++ b/docs/en/gun/1.1/guide/start/index.html
@@ -67,16 +67,12 @@
<p>Specify Gun as a dependency to your application in your favorite build tool.</p>
<p>With Erlang.mk this is done by adding <code>gun</code> to the <code>DEPS</code> variable in your Makefile.</p>
<div class="listingblock"><div class="title">Adding Gun as an Erlang.mk dependency</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite -->
-<pre><tt><font color="#009900">DEPS =</font> gun</tt></pre>
+<div class="content">source-highlight: could not find a language definition for make
</div></div>
<h2 id="_starting">Starting</h2>
<p>Gun is an <em>OTP application</em>. It needs to be started before you can use it.</p>
<div class="listingblock"><div class="title">Starting Gun in an Erlang shell</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -86,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->
<h2 id="_stopping">Stopping</h2>
<p>You can stop Gun using the <code>application:stop/1</code> function, however only Gun will be stopped. This is the reverse of <code>application:start/1</code>. The <code>application_ensure_all_started/1</code> function has no equivalent for stopping all applications.</p>
<div class="listingblock"><div class="title">Stopping Gun</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
diff --git a/docs/en/gun/1.1/guide/websocket/index.html b/docs/en/gun/1.1/guide/websocket/index.html
index 6ffbda96..3874a12d 100644
--- a/docs/en/gun/1.1/guide/websocket/index.html
+++ b/docs/en/gun/1.1/guide/websocket/index.html
@@ -68,7 +68,7 @@
<p>Websocket is a protocol built on top of HTTP. To use Websocket, you must first request for the connection to be upgraded. Only HTTP/1.1 connections can be upgraded to Websocket, so you might need to restrict the protocol to HTTP/1.1 if you are planning to use Websocket over TLS.</p>
<p>You must use the <code>gun:ws_upgrade/2,3,4</code> function to upgrade to Websocket. This function can be called anytime after connection, so you can send HTTP requests before upgrading to Websocket.</p>
<div class="listingblock"><div class="title">Upgrade to Websocket</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -76,7 +76,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>Gun will set all the necessary headers for performing the Websocket upgrade, but you can specify additional headers if needed. For example you can request a custom sub-protocol.</p>
<div class="listingblock"><div class="title">Upgrade to Websocket and request a protocol</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -87,7 +87,7 @@ http://www.gnu.org/software/src-highlite -->
<p>You can pass the Websocket options as part of the <code>gun:open/2,3</code> call when opening the connection, or using the <code>gun:ws_upgrade/4</code>. The fourth argument is those same options.</p>
<p>When the upgrade succeeds, a <code>gun_upgrade</code> message is sent. If the server does not understand Websocket or refused the upgrade, a <code>gun_response</code> message is sent. If Gun couldn&apos;t perform the upgrade due to an error (for example attempting to upgrade to Websocket on an HTTP/1.0 connection) then a <code>gun_error</code> message is sent.</p>
<p>When the server does not understand Websocket, it may send a meaningful response which should be processed. In the following example we however ignore it:</p>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<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 -->
@@ -107,7 +107,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Once the Websocket upgrade has completed successfully, you no longer have access to functions for performing requests. You can only send and receive Websocket messages.</p>
<p>Use <code>gun:ws_send/2</code> to send messages to the server.</p>
<div class="listingblock"><div class="title">Send a text frame</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -127,7 +127,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Note that if you send a close frame, Gun will close the connection cleanly but will attempt to reconnect afterwards.</p>
<h2 id="_receiving_data">Receiving data</h2>
<p>Gun sends an Erlang message to the owner process for every Websocket message it receives.</p>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<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 -->