summaryrefslogtreecommitdiffstats
path: root/docs/en/gun
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-08-23 15:07:40 +0200
committerLoïc Hoguin <[email protected]>2017-08-23 15:07:40 +0200
commit1f8d51dd2692fc3978080419987bbe4d49a41a90 (patch)
treea037e30b31c19b27929ac2fafc029914a9291966 /docs/en/gun
parentd344725cfd7169605ddecca46b9901af9f43ff1f (diff)
downloadninenines.eu-1f8d51dd2692fc3978080419987bbe4d49a41a90.tar.gz
ninenines.eu-1f8d51dd2692fc3978080419987bbe4d49a41a90.tar.bz2
ninenines.eu-1f8d51dd2692fc3978080419987bbe4d49a41a90.zip
Cowboy 2.0.0-rc.2
Diffstat (limited to 'docs/en/gun')
-rw-r--r--docs/en/gun/1.0/guide/connect.asciidoc8
-rw-r--r--docs/en/gun/1.0/guide/connect/index.html8
-rw-r--r--docs/en/gun/1.0/guide/http.asciidoc8
-rw-r--r--docs/en/gun/1.0/guide/http/index.html8
-rw-r--r--docs/en/gun/1.0/guide/introduction.asciidoc4
-rw-r--r--docs/en/gun/1.0/guide/introduction/index.html4
-rw-r--r--docs/en/gun/1.0/guide/protocols.asciidoc60
-rw-r--r--docs/en/gun/1.0/guide/protocols/index.html16
-rw-r--r--docs/en/gun/1.0/manual/gun/index.html56
-rw-r--r--docs/en/gun/1.0/manual/gun_app/index.html4
10 files changed, 88 insertions, 88 deletions
diff --git a/docs/en/gun/1.0/guide/connect.asciidoc b/docs/en/gun/1.0/guide/connect.asciidoc
index c2e887c1..e0b09d6c 100644
--- a/docs/en/gun/1.0/guide/connect.asciidoc
+++ b/docs/en/gun/1.0/guide/connect.asciidoc
@@ -5,10 +5,10 @@ a connection using the Gun client.
=== Gun connections
-Gun is designed with the SPDY and Websocket protocols in mind.
+Gun is designed with the HTTP/2 and Websocket protocols in mind.
They are built for long-running connections that allow concurrent
exchange of data, either in the form of request/responses for
-SPDY or in the form of messages for Websocket.
+HTTP/2 or in the form of messages for Websocket.
A Gun connection is an Erlang process that manages a socket to
a remote endpoint. This Gun connection is owned by a user
@@ -35,8 +35,8 @@ The `gun:open/{2,3}` function must be used to open a connection.
If the port given is 443, Gun will attempt to connect using
SSL. The protocol will be selected automatically using the
-NPN extension for TLS. By default Gun supports SPDY/3.1,
-SPDY/3 and HTTP/1.1 when connecting using SSL.
+ALPN extension for TLS. By default Gun supports HTTP/2
+and HTTP/1.1 when connecting using SSL.
For any other port, Gun will attempt to connect using TCP
and will use the HTTP/1.1 protocol.
diff --git a/docs/en/gun/1.0/guide/connect/index.html b/docs/en/gun/1.0/guide/connect/index.html
index e91bb7c8..50035be4 100644
--- a/docs/en/gun/1.0/guide/connect/index.html
+++ b/docs/en/gun/1.0/guide/connect/index.html
@@ -72,10 +72,10 @@ a connection using the Gun client.</p></div>
<div class="sect1">
<h2 id="_gun_connections">Gun connections</h2>
<div class="sectionbody">
-<div class="paragraph"><p>Gun is designed with the SPDY and Websocket protocols in mind.
+<div class="paragraph"><p>Gun is designed with the HTTP/2 and Websocket protocols in mind.
They are built for long-running connections that allow concurrent
exchange of data, either in the form of request/responses for
-SPDY or in the form of messages for Websocket.</p></div>
+HTTP/2 or in the form of messages for Websocket.</p></div>
<div class="paragraph"><p>A Gun connection is an Erlang process that manages a socket to
a remote endpoint. This Gun connection is owned by a user
process that is called the <em>owner</em> of the connection, and is
@@ -102,8 +102,8 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt>{<span style="color: #FF6600">ok</span>, <span style="color: #009900">ConnPid</span>} <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">gun:open</span></span>(<span style="color: #FF0000">"example.org"</span>, <span style="color: #993399">443</span>)<span style="color: #990000">.</span></tt></pre></div></div>
<div class="paragraph"><p>If the port given is 443, Gun will attempt to connect using
SSL. The protocol will be selected automatically using the
-NPN extension for TLS. By default Gun supports SPDY/3.1,
-SPDY/3 and HTTP/1.1 when connecting using SSL.</p></div>
+ALPN extension for TLS. By default Gun supports HTTP/2
+and HTTP/1.1 when connecting using SSL.</p></div>
<div class="paragraph"><p>For any other port, Gun will attempt to connect using TCP
and will use the HTTP/1.1 protocol.</p></div>
<div class="paragraph"><p>The transport and protocol used can be overriden using
diff --git a/docs/en/gun/1.0/guide/http.asciidoc b/docs/en/gun/1.0/guide/http.asciidoc
index e856fb18..ff4aa0aa 100644
--- a/docs/en/gun/1.0/guide/http.asciidoc
+++ b/docs/en/gun/1.0/guide/http.asciidoc
@@ -1,7 +1,7 @@
== HTTP
This chapter describes how to use the Gun client for
-communicating with an HTTP/1.1 or SPDY server.
+communicating with an HTTP/1.1 or HTTP/2 server.
=== Streams
@@ -130,7 +130,7 @@ the request has no body.
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 SPDY will continue normally as it is chunked by design.
+and HTTP/2 will continue normally as it is chunked by design.
.POST "/organizations/ninenines" with delayed body
@@ -234,7 +234,7 @@ data messages following. If it contains `fin` there will be
no data messages. If it contains `nofin` then one or more data
messages will follow.
-When using SPDY this value is sent with the frame and simply
+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.
@@ -309,7 +309,7 @@ end.
=== Handling streams pushed by the server
-The SPDY protocol allows the server to push more than one
+The HTTP/2 protocol allows the server to push more than one
resource for every request. It will start sending those
extra resources before it starts sending the response itself,
so Gun will send you `gun_push` messages before `gun_response`
diff --git a/docs/en/gun/1.0/guide/http/index.html b/docs/en/gun/1.0/guide/http/index.html
index 983d3e91..668d3ff6 100644
--- a/docs/en/gun/1.0/guide/http/index.html
+++ b/docs/en/gun/1.0/guide/http/index.html
@@ -68,7 +68,7 @@
<h1 class="lined-header"><span>HTTP</span></h1>
<div class="paragraph"><p>This chapter describes how to use the Gun client for
-communicating with an HTTP/1.1 or SPDY server.</p></div>
+communicating with an HTTP/1.1 or HTTP/2 server.</p></div>
<div class="sect1">
<h2 id="_streams">Streams</h2>
<div class="sectionbody">
@@ -194,7 +194,7 @@ the request has no body.</p></div>
<div class="paragraph"><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 SPDY will continue normally as it is chunked by design.</p></div>
+and HTTP/2 will continue normally as it is chunked by design.</p></div>
<div class="listingblock">
<div class="title">POST "/organizations/ninenines" with delayed body</div>
<div class="content"><!-- Generator: GNU source-highlight 3.1.8
@@ -310,7 +310,7 @@ a <code>gun_error</code> message is sent instead.</p></div>
data messages following. If it contains <code>fin</code> there will be
no data messages. If it contains <code>nofin</code> then one or more data
messages will follow.</p></div>
-<div class="paragraph"><p>When using SPDY this value is sent with the frame and simply
+<div class="paragraph"><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></div>
<div class="paragraph"><p>You can receive messages directly, or you can use the <em>await</em>
@@ -383,7 +383,7 @@ http://www.gnu.org/software/src-highlite -->
<div class="sect1">
<h2 id="_handling_streams_pushed_by_the_server">Handling streams pushed by the server</h2>
<div class="sectionbody">
-<div class="paragraph"><p>The SPDY protocol allows the server to push more than one
+<div class="paragraph"><p>The HTTP/2 protocol allows the server to push more than one
resource for every request. It will start sending those
extra resources before it starts sending the response itself,
so Gun will send you <code>gun_push</code> messages before <code>gun_response</code>
diff --git a/docs/en/gun/1.0/guide/introduction.asciidoc b/docs/en/gun/1.0/guide/introduction.asciidoc
index 2914ef62..89f2ae71 100644
--- a/docs/en/gun/1.0/guide/introduction.asciidoc
+++ b/docs/en/gun/1.0/guide/introduction.asciidoc
@@ -1,10 +1,10 @@
== Introduction
-Gun is an Erlang HTTP client with support for HTTP/1.1, SPDY and Websocket.
+Gun is an Erlang HTTP client with support for HTTP/1.1, HTTP/2 and Websocket.
=== Prerequisites
-Knowledge of Erlang, but also of the HTTP/1.1, SPDY and Websocket
+Knowledge of Erlang, but also of the HTTP/1.1, HTTP/2 and Websocket
protocols is required in order to read this guide.
=== Supported platforms
diff --git a/docs/en/gun/1.0/guide/introduction/index.html b/docs/en/gun/1.0/guide/introduction/index.html
index b159b1db..46d1fc33 100644
--- a/docs/en/gun/1.0/guide/introduction/index.html
+++ b/docs/en/gun/1.0/guide/introduction/index.html
@@ -67,11 +67,11 @@
<h1 class="lined-header"><span>Introduction</span></h1>
-<div class="paragraph"><p>Gun is an Erlang HTTP client with support for HTTP/1.1, SPDY and Websocket.</p></div>
+<div class="paragraph"><p>Gun is an Erlang HTTP client with support for HTTP/1.1, HTTP/2 and Websocket.</p></div>
<div class="sect1">
<h2 id="_prerequisites">Prerequisites</h2>
<div class="sectionbody">
-<div class="paragraph"><p>Knowledge of Erlang, but also of the HTTP/1.1, SPDY and Websocket
+<div class="paragraph"><p>Knowledge of Erlang, but also of the HTTP/1.1, HTTP/2 and Websocket
protocols is required in order to read this guide.</p></div>
</div>
</div>
diff --git a/docs/en/gun/1.0/guide/protocols.asciidoc b/docs/en/gun/1.0/guide/protocols.asciidoc
index 5e3b273e..ae7705ff 100644
--- a/docs/en/gun/1.0/guide/protocols.asciidoc
+++ b/docs/en/gun/1.0/guide/protocols.asciidoc
@@ -37,29 +37,29 @@ It provides the `gun:ws_upgrade/{2,3,4}` function for that
purpose. A `gun_ws_upgrade` message will be sent on success;
a `gun_response` message otherwise.
-=== SPDY
+=== HTTP/2
-SPDY is a binary protocol based on HTTP, compatible with
+HTTP/2 is a binary protocol based on HTTP, compatible with
the HTTP semantics, that reduces the complexity of parsing
requests and responses, compresses the HTTP headers and
allows the server to push multiple responses to a single
request.
-The SPDY interface is very similar to HTTP/1.1, so this
+The HTTP/2 interface is very similar to HTTP/1.1, so this
section instead focuses on the differences in the interface
for the two protocols.
-Because a SPDY server can push multiple responses to a
+Because a HTTP/2 server can push multiple responses to a
single request, Gun might send `gun_push` messages for
every push received. They can be ignored safely if they
are not needed.
-The `gun:cancel/2` function will use the SPDY stream
+The `gun:cancel/2` function will use the HTTP/2 stream
cancellation mechanism which allows Gun to inform the
server to stop sending a response for this particular
request, saving resources.
-It is not possible to upgrade a SPDY connection to Websocket
+It is not possible to upgrade an HTTP/2 connection to Websocket
due to protocol limitations.
=== Websocket
@@ -87,33 +87,33 @@ current protocol.
.Supported operations per protocol
[cols="<,3*^",options="header"]
|===
-| Operation | HTTP/1.1 | SPDY | Websocket
-| delete | yes | yes | no
-| get | yes | yes | no
-| head | yes | yes | no
-| options | yes | yes | no
-| patch | yes | yes | no
-| post | yes | yes | no
-| put | yes | yes | no
-| request | yes | yes | no
-| data | yes | yes | no
-| await | yes | yes | no
-| await_body | yes | yes | no
-| flush | yes | yes | no
-| cancel | yes | yes | no
-| ws_upgrade | yes | no | no
-| ws_send | no | no | yes
+| Operation | HTTP/1.1 | HTTP/2 | Websocket
+| delete | yes | yes | no
+| get | yes | yes | no
+| head | yes | yes | no
+| options | yes | yes | no
+| patch | yes | yes | no
+| post | yes | yes | no
+| put | yes | yes | no
+| request | yes | yes | no
+| data | yes | yes | no
+| await | yes | yes | no
+| await_body | yes | yes | no
+| flush | yes | yes | no
+| cancel | yes | yes | no
+| ws_upgrade | yes | no | no
+| ws_send | no | no | yes
|===
.Messages sent per protocol
[cols="<,3*^",options="header"]
|===
-| Message | HTTP/1.1 | SPDY | Websocket
-| gun_push | no | yes | no
-| gun_response | yes | yes | no
-| gun_data | yes | yes | no
-| gun_error (StreamRef) | yes | yes | no
-| gun_error | yes | yes | yes
-| gun_ws_upgrade | yes | no | no
-| gun_ws | no | no | yes
+| Message | HTTP/1.1 | HTTP/2 | Websocket
+| gun_push | no | yes | no
+| gun_response | yes | yes | no
+| gun_data | yes | yes | no
+| gun_error (StreamRef) | yes | yes | no
+| gun_error | yes | yes | yes
+| gun_ws_upgrade | yes | no | no
+| gun_ws | no | no | yes
|===
diff --git a/docs/en/gun/1.0/guide/protocols/index.html b/docs/en/gun/1.0/guide/protocols/index.html
index d14c87fa..38b05bfd 100644
--- a/docs/en/gun/1.0/guide/protocols/index.html
+++ b/docs/en/gun/1.0/guide/protocols/index.html
@@ -101,25 +101,25 @@ a <code>gun_response</code> message otherwise.</p></div>
</div>
</div>
<div class="sect1">
-<h2 id="_spdy">SPDY</h2>
+<h2 id="_http_2">HTTP/2</h2>
<div class="sectionbody">
-<div class="paragraph"><p>SPDY is a binary protocol based on HTTP, compatible with
+<div class="paragraph"><p>HTTP/2 is a binary protocol based on HTTP, compatible with
the HTTP semantics, that reduces the complexity of parsing
requests and responses, compresses the HTTP headers and
allows the server to push multiple responses to a single
request.</p></div>
-<div class="paragraph"><p>The SPDY interface is very similar to HTTP/1.1, so this
+<div class="paragraph"><p>The HTTP/2 interface is very similar to HTTP/1.1, so this
section instead focuses on the differences in the interface
for the two protocols.</p></div>
-<div class="paragraph"><p>Because a SPDY server can push multiple responses to a
+<div class="paragraph"><p>Because a HTTP/2 server can push multiple responses to a
single request, Gun might send <code>gun_push</code> messages for
every push received. They can be ignored safely if they
are not needed.</p></div>
-<div class="paragraph"><p>The <code>gun:cancel/2</code> function will use the SPDY stream
+<div class="paragraph"><p>The <code>gun:cancel/2</code> function will use the HTTP/2 stream
cancellation mechanism which allows Gun to inform the
server to stop sending a response for this particular
request, saving resources.</p></div>
-<div class="paragraph"><p>It is not possible to upgrade a SPDY connection to Websocket
+<div class="paragraph"><p>It is not possible to upgrade an HTTP/2 connection to Websocket
due to protocol limitations.</p></div>
</div>
</div>
@@ -157,7 +157,7 @@ cellspacing="0" cellpadding="4">
<tr>
<th align="left" valign="top"> Operation </th>
<th align="center" valign="top"> HTTP/1.1 </th>
-<th align="center" valign="top"> SPDY </th>
+<th align="center" valign="top"> HTTP/2 </th>
<th align="center" valign="top"> Websocket</th>
</tr>
</thead>
@@ -268,7 +268,7 @@ cellspacing="0" cellpadding="4">
<tr>
<th align="left" valign="top"> Message </th>
<th align="center" valign="top"> HTTP/1.1 </th>
-<th align="center" valign="top"> SPDY </th>
+<th align="center" valign="top"> HTTP/2 </th>
<th align="center" valign="top"> Websocket</th>
</tr>
</thead>
diff --git a/docs/en/gun/1.0/manual/gun/index.html b/docs/en/gun/1.0/manual/gun/index.html
index 4016ea73..9fedee7e 100644
--- a/docs/en/gun/1.0/manual/gun/index.html
+++ b/docs/en/gun/1.0/manual/gun/index.html
@@ -77,8 +77,8 @@
<h2 id="_description">Description</h2>
<div class="sectionbody">
<div class="paragraph"><p>The <code>gun</code> module provides an asynchronous interface for
-connecting and communicating with Web servers over SPDY,
-HTTP or Websocket.</p></div>
+connecting and communicating with Web servers over HTTP,
+HTTP/2 or Websocket.</p></div>
</div>
</div>
<div class="sect1">
@@ -106,16 +106,24 @@ http_opts &#8658; http_opts()
</p>
</dd>
<dt class="hdlist1">
-protocols &#8658; [http | spdy]
+http2_opts &#8658; http2_opts()
+</dt>
+<dd>
+<p>
+ Options specific to the HTTP/2 protocol. See below.
+</p>
+</dd>
+<dt class="hdlist1">
+protocols &#8658; [http | http2]
</dt>
<dd>
<p>
Ordered list of preferred protocols. When the transport is tcp,
this list must contain exactly one protocol. When the transport
is ssl, this list must contain at least one protocol and will be
- used using the NPN protocol negotiation method. When the server
- does not support NPN then http will always be used. Defaults to
- [http] when the transport is tcp, and [spdy, http] when the
+ used using the ALPN protocol negotiation method. When the server
+ does not support ALPN then http will always be used. Defaults to
+ [http] when the transport is tcp, and [http2, http] when the
transport is ssl.
</p>
</dd>
@@ -137,14 +145,6 @@ retry_timeout &#8658; pos_integer()
</p>
</dd>
<dt class="hdlist1">
-spdy_opts &#8658; spdy_opts()
-</dt>
-<dd>
-<p>
- Options specific to the SPDY protocol. See below.
-</p>
-</dd>
-<dt class="hdlist1">
trace &#8658; boolean()
</dt>
<dd>
@@ -187,7 +187,7 @@ ws_opts &#8658; ws_opts()
<div class="paragraph"><p>The following keys are defined:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
-keepalive &#8658; pos_integer()
+keepalive &#8658; timeout()
</dt>
<dd>
<p>
@@ -195,7 +195,7 @@ keepalive &#8658; pos_integer()
no standardized way to ping the server, Gun will simply send an
empty line when the connection is idle. Gun only makes a best
effort here as servers usually have configurable limits to drop
- idle connections. Defaults to 5000.
+ idle connections. Use <code>infinity</code> to disable. Defaults to 5000.
</p>
</dd>
<dt class="hdlist1">
@@ -221,31 +221,31 @@ version &#8658; <em>HTTP/1.1</em> | <em>HTTP/1.0</em>
</dl></div>
</div>
<div class="sect2">
-<h3 id="_req_opts_map">req_opts() = map()</h3>
-<div class="paragraph"><p>Configuration for a particular request.</p></div>
+<h3 id="_http2_opts_map">http2_opts() = map()</h3>
+<div class="paragraph"><p>Configuration for the HTTP/2 protocol.</p></div>
<div class="paragraph"><p>The following keys are defined:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
-reply_to &#8658; pid()
+keepalive &#8658; pos_integer()
</dt>
<dd>
<p>
- The pid of a process that is responsible for the response handling.
+ Time between pings in milliseconds. Defaults to 5000.
</p>
</dd>
</dl></div>
</div>
<div class="sect2">
-<h3 id="_spdy_opts_map">spdy_opts() = map()</h3>
-<div class="paragraph"><p>Configuration for the SPDY protocol.</p></div>
+<h3 id="_req_opts_map">req_opts() = map()</h3>
+<div class="paragraph"><p>Configuration for a particular request.</p></div>
<div class="paragraph"><p>The following keys are defined:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
-keepalive &#8658; pos_integer()
+reply_to &#8658; pid()
</dt>
<dd>
<p>
- Time between pings in milliseconds. Defaults to 5000.
+ The pid of a process that is responsible for the response handling.
</p>
</dd>
</dl></div>
@@ -286,7 +286,7 @@ The pid of the Gun connection process.
</p>
</dd>
<dt class="hdlist1">
-Protocol = http | spdy
+Protocol = http | http2
</dt>
<dd>
<p>
@@ -318,7 +318,7 @@ The pid of the Gun connection process.
</p>
</dd>
<dt class="hdlist1">
-Protocol = http | spdy | ws
+Protocol = http | http2 | ws
</dt>
<dd>
<p>
@@ -413,7 +413,7 @@ Headers @todo
</dd>
</dl></div>
<div class="paragraph"><p>A resource pushed alongside an HTTP response.</p></div>
-<div class="paragraph"><p>This message can only be sent when the protocol is SPDY.</p></div>
+<div class="paragraph"><p>This message can only be sent when the protocol is HTTP/2.</p></div>
<div class="paragraph"><p>@todo I fear we also need the scheme; resource is identified by URI
@todo Perhaps we really should send the URI entirely, because cache
@todo relies on URI to work and this feature is for caching&#8230;
@@ -1716,7 +1716,7 @@ the stream and stop relaying messages.</p></div>
<div class="paragraph"><p>@todo Depending on the length
@todo of a response Gun may also attempt to reconnect rather than
@todo receive the entire response body.</p></div>
-<div class="paragraph"><p>SPDY streams can however be cancelled at any time.</p></div>
+<div class="paragraph"><p>HTTP/2 streams can however be cancelled at any time.</p></div>
</div>
<div class="sect2">
<h3 id="_ws_upgrade_connpid_path_8594_ws_upgrade_connpid_path">ws_upgrade(ConnPid, Path) &#8594; ws_upgrade(ConnPid, Path, [], #{})</h3>
diff --git a/docs/en/gun/1.0/manual/gun_app/index.html b/docs/en/gun/1.0/manual/gun_app/index.html
index f116490a..be525d51 100644
--- a/docs/en/gun/1.0/manual/gun_app/index.html
+++ b/docs/en/gun/1.0/manual/gun_app/index.html
@@ -70,7 +70,7 @@
<div class="sect1">
<h2 id="_name">Name</h2>
<div class="sectionbody">
-<div class="paragraph"><p>gun - Erlang HTTP client with support for HTTP/1.1, SPDY and Websocket.</p></div>
+<div class="paragraph"><p>gun - Erlang HTTP client with support for HTTP/1.1, HTTP/2 and Websocket.</p></div>
</div>
</div>
<div class="sect1">
@@ -79,7 +79,7 @@
<div class="paragraph"><p>The <code>gun</code> application uses the Erlang applications <code>ranch</code>
for abstracting TCP and TLS over a common interface, and
the <code>ssl</code> application for TLS support, required for HTTPS
-and SPDY support. In addition, Gun requires the <code>crypto</code>
+and secure HTTP/2 support. In addition, Gun requires the <code>crypto</code>
application (a dependency of <code>ssl</code>) for Websocket.</p></div>
<div class="paragraph"><p>These dependencies must be started for the <code>gun</code>
application to work. In an embedded environment