summaryrefslogtreecommitdiffstats
path: root/docs/index.xml
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-09-14 13:46:37 +0200
committerLoïc Hoguin <[email protected]>2016-09-14 13:46:37 +0200
commit62f5d70836fe9a211ebfe9551bf02f67049cf86c (patch)
tree40ee9d5acc42d4953ca5d04212d364728ad91ce5 /docs/index.xml
parentd354fdf0fa439d9e403cec498c1318ffc9f61a41 (diff)
downloadninenines.eu-62f5d70836fe9a211ebfe9551bf02f67049cf86c.tar.gz
ninenines.eu-62f5d70836fe9a211ebfe9551bf02f67049cf86c.tar.bz2
ninenines.eu-62f5d70836fe9a211ebfe9551bf02f67049cf86c.zip
Add prev/next links at the bottom of user guide pages
Diffstat (limited to 'docs/index.xml')
-rw-r--r--docs/index.xml3135
1 files changed, 1527 insertions, 1608 deletions
diff --git a/docs/index.xml b/docs/index.xml
index 56e19789..d301fc08 100644
--- a/docs/index.xml
+++ b/docs/index.xml
@@ -9,1402 +9,885 @@
<atom:link href="http://ninenines.eu/docs/index.xml" rel="self" type="application/rss+xml" />
<item>
- <title>Architecture</title>
- <link>http://ninenines.eu/docs/en/cowboy/2.0/guide/architecture/</link>
+ <title>Cowboy Function Reference</title>
+ <link>http://ninenines.eu/docs/en/cowboy/2.0/manual/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
- <guid>http://ninenines.eu/docs/en/cowboy/2.0/guide/architecture/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy is a lightweight HTTP server.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;It is built on top of Ranch. Please see the Ranch guide for more
-information.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_one_process_per_connection&#34;&gt;One process per connection&lt;/h2&gt;
+ <guid>http://ninenines.eu/docs/en/cowboy/2.0/manual/</guid>
+ <description>&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_app&#34;&gt;cowboy(7)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy&#34;&gt;cowboy(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_handler&#34;&gt;cowboy_handler(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_loop&#34;&gt;cowboy_loop(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_middleware&#34;&gt;cowboy_middleware(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_protocol&#34;&gt;cowboy_protocol(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_req&#34;&gt;cowboy_req(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_rest&#34;&gt;cowboy_rest(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_router&#34;&gt;cowboy_router(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_static&#34;&gt;cowboy_static(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_sub_protocol&#34;&gt;cowboy_sub_protocol(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cowboy_websocket&#34;&gt;cowboy_websocket(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;http_status_codes&#34;&gt;HTTP status codes(7)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
+</description>
+ </item>
+
+ <item>
+ <title>Cowboy User Guide</title>
+ <link>http://ninenines.eu/docs/en/cowboy/2.0/guide/</link>
+ <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
+
+ <guid>http://ninenines.eu/docs/en/cowboy/2.0/guide/</guid>
+ <description>&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_rationale&#34;&gt;Rationale&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;It uses only one process per connection. The process where your
-code runs is the process controlling the socket. Using one process
-instead of two allows for lower memory usage.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Because there can be more than one request per connection with the
-keepalive feature of HTTP/1.1, that means the same process will be
-used to handle many requests.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Because of this, you are expected to make sure your process cleans
-up before terminating the handling of the current request. This may
-include cleaning up the process dictionary, timers, monitoring and
-more.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;modern_web/&#34;&gt;The modern Web&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;erlang_web/&#34;&gt;Erlang and the Web&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_binaries&#34;&gt;Binaries&lt;/h2&gt;
+&lt;h2 id=&#34;_introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;It uses binaries. Binaries are more efficient than lists for
-representing strings because they take less memory space. Processing
-performance can vary depending on the operation. Binaries are known
-for generally getting a great boost if the code is compiled natively.
-Please see the HiPE documentation for more details.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;introduction/&#34;&gt;Introduction&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;getting_started/&#34;&gt;Getting started&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;flow_diagram/&#34;&gt;Flow diagram&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_date_header&#34;&gt;Date header&lt;/h2&gt;
+&lt;h2 id=&#34;_configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Because querying for the current date and time can be expensive,
-Cowboy generates one &lt;code&gt;Date&lt;/code&gt; header value every second, shares it
-to all other processes, which then simply copy it in the response.
-This allows compliance with HTTP/1.1 with no actual performance loss.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;listeners/&#34;&gt;Listeners&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;streams/&#34;&gt;Streams&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;routing/&#34;&gt;Routing&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;constraints/&#34;&gt;Constraints&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_max_connections&#34;&gt;Max connections&lt;/h2&gt;
+&lt;h2 id=&#34;_handlers&#34;&gt;Handlers&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;By default the maximum number of active connections is set to a
-generally accepted big enough number. This is meant to prevent having
-too many processes performing potentially heavy work and slowing
-everything else down, or taking up all the memory.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Disabling this feature, by setting the &lt;code&gt;{max_connections, infinity}&lt;/code&gt;
-protocol option, would give you greater performance when you are
-only processing short-lived requests.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;handlers/&#34;&gt;Handlers&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;loop_handlers/&#34;&gt;Loop handlers&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;static_files/&#34;&gt;Static files&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
-</description>
- </item>
-
- <item>
- <title>AsciiDoc documentation</title>
- <link>http://ninenines.eu/docs/en/erlang.mk/1/guide/asciidoc/</link>
- <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
-
- <guid>http://ninenines.eu/docs/en/erlang.mk/1/guide/asciidoc/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk provides rules for generating documentation from
-AsciiDoc files. It can automatically build a user guide PDF,
-chunked HTML documentation and Unix manual pages.&lt;/p&gt;&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_requirements&#34;&gt;Requirements&lt;/h2&gt;
+&lt;h2 id=&#34;_request_and_response&#34;&gt;Request and response&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;It is necessary to have &lt;a href=&#34;http://asciidoc.org/&#34;&gt;AsciiDoc&lt;/a&gt;,
-&lt;a href=&#34;http://xmlsoft.org/XSLT/xsltproc2.html&#34;&gt;xsltproc&lt;/a&gt; and
-&lt;a href=&#34;http://dblatex.sourceforge.net/&#34;&gt;dblatex&lt;/a&gt; installed on your
-system for Erlang.mk to generate documentation from AsciiDoc sources.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;req/&#34;&gt;Request details&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;req_body/&#34;&gt;Reading the request body&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;resp/&#34;&gt;Sending a response&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;cookies/&#34;&gt;Using cookies&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;multipart/&#34;&gt;Multipart&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_writing_asciidoc_documentation&#34;&gt;Writing AsciiDoc documentation&lt;/h2&gt;
+&lt;h2 id=&#34;_rest&#34;&gt;REST&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;&lt;a href=&#34;http://asciidoc.org/&#34;&gt;AsciiDoc&lt;/a&gt; is a text document format for
-writing notes, documentation, articles, books, ebooks, slideshows,
-web pages, man pages and blogs. AsciiDoc files can be translated
-to many formats including HTML, PDF, EPUB, man page.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;a href=&#34;http://asciidoc.org/userguide.html&#34;&gt;AsciiDoc user guide&lt;/a&gt;
-describes the AsciiDoc syntax.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;a href=&#34;https://github.com/ninenines/erlang.mk/tree/master/doc/src/guide&#34;&gt;Erlang.mk user guide&lt;/a&gt;
-is written in AsciiDoc and can be used as an example. The entry
-file is &lt;a href=&#34;https://github.com/ninenines/erlang.mk/blob/master/doc/src/guide/book.asciidoc&#34;&gt;book.asciidoc&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk expects you to put your documentation in a specific
-location. This is &lt;em&gt;doc/src/guide/&lt;/em&gt; for the user guide, and
-&lt;em&gt;doc/src/manual/&lt;/em&gt; for the function reference. In the case of
-the user guide, the entry point is always &lt;em&gt;doc/src/guide/book.asciidoc&lt;/em&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;For manual pages, it is good practice to use section 3 for
-modules, and section 7 for the application itself.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;rest_principles/&#34;&gt;REST principles&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;rest_handlers/&#34;&gt;Handling REST requests&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;rest_flowcharts/&#34;&gt;REST flowcharts&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;resource_design/&#34;&gt;Designing a resource handler&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_configuration&#34;&gt;Configuration&lt;/h2&gt;
+&lt;h2 id=&#34;_websocket&#34;&gt;Websocket&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;All of the AsciiDoc related configuration can be done directly
-inside the files themselves.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;ws_protocol/&#34;&gt;The Websocket protocol&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;ws_handlers/&#34;&gt;Handling Websocket connections&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_usage&#34;&gt;Usage&lt;/h2&gt;
+&lt;h2 id=&#34;_internals&#34;&gt;Internals&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To build all documentation:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make docs&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To build only the AsciiDoc documentation:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make asciidoc&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To build only the user guide:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make asciidoc-guide&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To build only the manual:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make asciidoc-manual&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To install man pages on Unix:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make install-docs&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk allows customizing the installation path and sections
-of the man pages to be installed. The &lt;code&gt;MAN_INSTALL_PATH&lt;/code&gt; variable
-defines where man pages will be installed. It defaults to
-&lt;em&gt;/usr/local/share/man&lt;/em&gt;. The &lt;code&gt;MAN_SECTIONS&lt;/code&gt; variable defines
-which manual sections are to be installed. It defaults to &lt;code&gt;3 7&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To install man pages to a custom location:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make install-docs &lt;span style=&#34;color: #009900&#34;&gt;MAN_INSTALL_PATH&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt;/opt/share/man&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Note that you may need to run the install commands using
-&lt;code&gt;sudo&lt;/code&gt; or equivalent if the location is not writeable by
-your user.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;architecture/&#34;&gt;Architecture&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;broken_clients/&#34;&gt;Dealing with broken clients&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;middlewares/&#34;&gt;Middlewares&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;sub_protocols/&#34;&gt;Sub protocols&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;hooks/&#34;&gt;Hooks&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
</item>
<item>
- <title>Building</title>
- <link>http://ninenines.eu/docs/en/erlang.mk/1/guide/app/</link>
+ <title>Erlang.mk User Guide</title>
+ <link>http://ninenines.eu/docs/en/erlang.mk/1/guide/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
- <guid>http://ninenines.eu/docs/en/erlang.mk/1/guide/app/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk can do a lot of things, but it is, first and
-foremost, a build tool. In this chapter we will cover
-the basics of building a project with Erlang.mk.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;For most of this chapter, we will assume that you are
-using a project &lt;a href=&#34;../getting_started&#34;&gt;generated by Erlang.mk&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;
+ <guid>http://ninenines.eu/docs/en/erlang.mk/1/guide/</guid>
+ <description>&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;installation/&#34;&gt;Installation&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;getting_started/&#34;&gt;Getting started&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;overview/&#34;&gt;Overview&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;updating/&#34;&gt;Updating Erlang.mk&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;limitations/&#34;&gt;Limitations&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_how_to_build&#34;&gt;How to build&lt;/h2&gt;
+&lt;h2 id=&#34;code&#34;&gt;Code&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To build a project, all you have to do is type &lt;code&gt;make&lt;/code&gt;:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;It will work regardless of your project: OTP applications,
-library applications, NIFs, port drivers or even releases.
-Erlang.mk also automatically downloads and compiles the
-dependencies for your project.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;All this is possible thanks to a combination of configuration
-and conventions. Most of the conventions come from Erlang/OTP
-itself so any seasoned Erlang developers should feel right at
-home.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_what_to_build&#34;&gt;What to build&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk gives you control over three steps of the build
-process, allowing you to do a partial build if needed.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;A build has three phases: first any dependency is fetched
-and built, then the project itself is built and finally a
-release may be generated when applicable. A release is only
-generated for projects specifically configured to do so.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk handles those three phases automatically when you
-type &lt;code&gt;make&lt;/code&gt;. But sometimes you just want to repeat one or
-two of them.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The commands detailed in this section are most useful after
-you have a successful build as they allow you to quickly
-redo a step instead of going through everything. This is
-especially useful for large projects or projects that end
-up generating releases.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;sect3&#34;&gt;
-&lt;h4 id=&#34;_application&#34;&gt;Application&lt;/h4&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;You can build your application and dependencies without
-generating a release by running the following command:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make app&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To build your application without touching dependencies
-at all, you can use the &lt;code&gt;SKIP_DEPS&lt;/code&gt; variable:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make app &lt;span style=&#34;color: #009900&#34;&gt;SKIP_DEPS&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color: #993399&#34;&gt;1&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This command is very useful if you have a lot of dependencies
-and develop on a machine with slow file access, like the
-Raspberry Pi and many other embedded devices.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Note that this command may fail if a required dependency
-is missing.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect3&#34;&gt;
-&lt;h4 id=&#34;_dependencies&#34;&gt;Dependencies&lt;/h4&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;You can build all dependencies, and nothing else, by
-running the following command:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make deps&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This will fetch and compile all dependencies and their
-dependencies, recursively.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;&lt;a href=&#34;../deps&#34;&gt;Packages and dependencies&lt;/a&gt; are covered
-in the next chapter.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect3&#34;&gt;
-&lt;h4 id=&#34;_release&#34;&gt;Release&lt;/h4&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;It is not possible to build the release without at least
-building the application itself, unless of course if there&amp;#8217;s
-no application to begin with.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To generate the release, &lt;code&gt;make&lt;/code&gt; will generally suffice with
-a normal Erlang.mk. A separate target is however available,
-and will take care of building the release, after building
-the application and all dependencies:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make rel&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Consult the &lt;a href=&#34;../relx&#34;&gt;Releases&lt;/a&gt; chapter for more
-information about what releases are and how they are generated.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_application_resource_file&#34;&gt;Application resource file&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When building your application, Erlang.mk will generate the
-&lt;a href=&#34;http://www.erlang.org/doc/man/app.html&#34;&gt;application resource file&lt;/a&gt;.
-This file is mandatory for all Erlang applications and is
-found in &lt;em&gt;ebin/$(PROJECT).app&lt;/em&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;&lt;code&gt;PROJECT&lt;/code&gt; is a variable defined in your Makefile and taken
-from the name of the directory when Erlang.mk bootstraps
-your project.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk can build the &lt;em&gt;ebin/$(PROJECT).app&lt;/em&gt; in two different
-ways: from the configuration found in the Makefile, or from
-the &lt;em&gt;src/$(PROJECT).app.src&lt;/em&gt; file.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;sect3&#34;&gt;
-&lt;h4 id=&#34;_application_configuration&#34;&gt;Application configuration&lt;/h4&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk automatically fills the &lt;code&gt;PROJECT&lt;/code&gt; variable when
-bootstrapping a new project, but everything else is up to
-you. None of the values are required to build your project,
-although it is recommended to fill everything relevant to
-your situation.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
-&lt;dt class=&#34;hdlist1&#34;&gt;
-&lt;code&gt;PROJECT&lt;/code&gt;
-&lt;/dt&gt;
-&lt;dd&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
&lt;p&gt;
- The name of the OTP application or library.
+&lt;a href=&#34;app/&#34;&gt;Building&lt;/a&gt;
&lt;/p&gt;
-&lt;/dd&gt;
-&lt;dt class=&#34;hdlist1&#34;&gt;
-&lt;code&gt;PROJECT_DESCRIPTION&lt;/code&gt;
-&lt;/dt&gt;
-&lt;dd&gt;
+&lt;/li&gt;
+&lt;li&gt;
&lt;p&gt;
- Short description of the project.
+&lt;a href=&#34;deps/&#34;&gt;Packages and dependencies&lt;/a&gt;
&lt;/p&gt;
-&lt;/dd&gt;
-&lt;dt class=&#34;hdlist1&#34;&gt;
-&lt;code&gt;PROJECT_VERSION&lt;/code&gt;
-&lt;/dt&gt;
-&lt;dd&gt;
+&lt;/li&gt;
+&lt;li&gt;
&lt;p&gt;
- Current version of the project.
+&lt;a href=&#34;ports/&#34;&gt;NIFs and port drivers&lt;/a&gt;
&lt;/p&gt;
-&lt;/dd&gt;
-&lt;dt class=&#34;hdlist1&#34;&gt;
-&lt;code&gt;PROJECT_MOD&lt;/code&gt;
-&lt;/dt&gt;
-&lt;dd&gt;
+&lt;/li&gt;
+&lt;li&gt;
&lt;p&gt;
- The application callback module.
+&lt;a href=&#34;releases/&#34;&gt;Releases&lt;/a&gt;
&lt;/p&gt;
-&lt;/dd&gt;
-&lt;dt class=&#34;hdlist1&#34;&gt;
-&lt;code&gt;PROJECT_REGISTERED&lt;/code&gt;
-&lt;/dt&gt;
-&lt;dd&gt;
+&lt;/li&gt;
+&lt;li&gt;
&lt;p&gt;
- List of the names of all registered processes.
+&lt;a href=&#34;escripts/&#34;&gt;Escripts&lt;/a&gt;
&lt;/p&gt;
-&lt;/dd&gt;
-&lt;dt class=&#34;hdlist1&#34;&gt;
-&lt;code&gt;LOCAL_DEPS&lt;/code&gt;
-&lt;/dt&gt;
-&lt;dd&gt;
+&lt;/li&gt;
+&lt;li&gt;
&lt;p&gt;
- List of Erlang/OTP applications this project depends on,
- excluding &lt;code&gt;erts&lt;/code&gt;, &lt;code&gt;kernel&lt;/code&gt; and &lt;code&gt;stdlib&lt;/code&gt;, or list of
- dependencies local to this repository (in &lt;code&gt;APPS_DIR&lt;/code&gt;).
+&lt;a href=&#34;compat/&#34;&gt;Compatibility with other build tools&lt;/a&gt;
&lt;/p&gt;
-&lt;/dd&gt;
-&lt;dt class=&#34;hdlist1&#34;&gt;
-&lt;code&gt;DEPS&lt;/code&gt;
-&lt;/dt&gt;
-&lt;dd&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;docs&#34;&gt;Documentation&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
&lt;p&gt;
- List of applications this project depends on that need
- to be fetched by Erlang.mk.
+&lt;a href=&#34;asciidoc/&#34;&gt;Asciidoc documentation&lt;/a&gt;
&lt;/p&gt;
-&lt;/dd&gt;
-&lt;/dl&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;There&amp;#8217;s no need for quotes or anything. The relevant part of
-the Cowboy Makefile follows, if you need an example:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Any space before and after the value is dropped.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;&lt;a href=&#34;../deps&#34;&gt;Dependencies&lt;/a&gt; are covered in details in
-the next chapter.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect3&#34;&gt;
-&lt;h4 id=&#34;_legacy_method&#34;&gt;Legacy method&lt;/h4&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;em&gt;src/$(PROJECT).app.src&lt;/em&gt; file is a legacy method of
-building Erlang applications. It was introduced by the original
-&lt;code&gt;rebar&lt;/code&gt; build tool, of which Erlang.mk owes a great deal as it
-is its main inspiration.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;em&gt;.app.src&lt;/em&gt; file serves as a template to generate the &lt;em&gt;.app&lt;/em&gt;
-file. Erlang.mk will take it, fill in the &lt;code&gt;modules&lt;/code&gt; value
-dynamically, and save the result in &lt;em&gt;ebin/$(PROJECT).app&lt;/em&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When using this method, Erlang.mk cannot fill the &lt;code&gt;applications&lt;/code&gt;
-key from dependencies automatically, which means you need to
-add them to Erlang.mk and to the &lt;em&gt;.app.src&lt;/em&gt; at the same time,
-duplicating the work.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you really can&amp;#8217;t live without the legacy method, for one
-reason or another, worry not; Erlang.mk will support it. And
-if you need to create a new project that uses this method, you
-just have to say so when bootstrapping:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make -f erlang&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;mk bootstrap-lib &lt;span style=&#34;color: #009900&#34;&gt;LEGACY&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color: #993399&#34;&gt;1&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;/div&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;edoc/&#34;&gt;EDoc comments&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_automatic_application_resource_file_values&#34;&gt;Automatic application resource file values&lt;/h2&gt;
+&lt;h2 id=&#34;tests&#34;&gt;Tests&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When building the application resource file, Erlang.mk may
-automatically add an &lt;code&gt;id&lt;/code&gt; key with information about the
-Git commit (if using Git), or an empty string otherwise.
-It will only do this under specific conditions:&lt;/p&gt;&lt;/div&gt;
&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
-The application was built as a dependency of another, or
+&lt;a href=&#34;shell/&#34;&gt;Erlang shell&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;eunit/&#34;&gt;EUnit&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-The legacy method was used, and the &lt;em&gt;.app.src&lt;/em&gt; file contained &lt;code&gt;{id, &#34;git&#34;}&lt;/code&gt;
+&lt;a href=&#34;common_test/&#34;&gt;Common Test&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;coverage/&#34;&gt;Code coverage&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;ci/&#34;&gt;Continuous integration&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;dialyzer/&#34;&gt;Dialyzer&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;xref/&#34;&gt;Xref&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This value is most useful when you need to help your users,
-as it allows you to know which version they run exactly by
-asking them to look in the file, or by running a simple
-command on their production server:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;color: #993399&#34;&gt;1&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;application:get_all_key&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #FF6600&#34;&gt;cowboy&lt;/span&gt;)&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;
-{&lt;span style=&#34;color: #FF6600&#34;&gt;ok&lt;/span&gt;,[{&lt;span style=&#34;color: #FF6600&#34;&gt;description&lt;/span&gt;,&lt;span style=&#34;color: #FF0000&#34;&gt;&#34;Small, fast, modular HTTP server.&#34;&lt;/span&gt;},
- {&lt;span style=&#34;color: #FF6600&#34;&gt;id&lt;/span&gt;,&lt;span style=&#34;color: #FF0000&#34;&gt;&#34;2.0.0-pre.2-25-g0ffde50-dirty&#34;&lt;/span&gt;},&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_file_formats&#34;&gt;File formats&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk supports a variety of different source file formats.
-The following formats are supported natively:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;tableblock&#34;&gt;
-&lt;table rules=&#34;all&#34;
-width=&#34;100%&#34;
-frame=&#34;border&#34;
-cellspacing=&#34;0&#34; cellpadding=&#34;4&#34;&gt;
-&lt;col width=&#34;25%&#34; /&gt;
-&lt;col width=&#34;25%&#34; /&gt;
-&lt;col width=&#34;25%&#34; /&gt;
-&lt;col width=&#34;25%&#34; /&gt;
-&lt;thead&gt;
-&lt;tr&gt;
-&lt;th align=&#34;left&#34; valign=&#34;top&#34;&gt; Extension &lt;/th&gt;
-&lt;th align=&#34;center&#34; valign=&#34;top&#34;&gt; Location &lt;/th&gt;
-&lt;th align=&#34;center&#34; valign=&#34;top&#34;&gt; Description &lt;/th&gt;
-&lt;th align=&#34;center&#34; valign=&#34;top&#34;&gt; Output&lt;/th&gt;
-&lt;/tr&gt;
-&lt;/thead&gt;
-&lt;tbody&gt;
-&lt;tr&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;.erl&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;src/&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;Erlang source&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;ebin/*.beam&lt;/p&gt;&lt;/td&gt;
-&lt;/tr&gt;
-&lt;tr&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;.core&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;src/&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;Core Erlang source&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;ebin/*.beam&lt;/p&gt;&lt;/td&gt;
-&lt;/tr&gt;
-&lt;tr&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;.xrl&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;src/&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;Leex source&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;src/*.erl&lt;/p&gt;&lt;/td&gt;
-&lt;/tr&gt;
-&lt;tr&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;.yrl&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;src/&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;Yecc source&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;src/*.erl&lt;/p&gt;&lt;/td&gt;
-&lt;/tr&gt;
-&lt;tr&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;.asn1&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;asn1/&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;ASN.1 files&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;include/&lt;strong&gt;.hrl include/&lt;/strong&gt;.asn1db src/*.erl&lt;/p&gt;&lt;/td&gt;
-&lt;/tr&gt;
-&lt;tr&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;.mib&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;mibs/&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;SNMP MIB files&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;include/&lt;strong&gt;.hrl priv/mibs/&lt;/strong&gt;.bin&lt;/p&gt;&lt;/td&gt;
-&lt;/tr&gt;
-&lt;/tbody&gt;
-&lt;/table&gt;
-&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Files are always searched recursively.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The build is ordered, so that files that generate Erlang source
-files are run before, and the resulting Erlang source files are
-then built normally.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;In addition, Erlang.mk keeps track of header files (&lt;code&gt;.hrl&lt;/code&gt;)
-as described at the end of this chapter. It can also compile
-C code, as described in the &lt;a href=&#34;../ports&#34;&gt;NIFs and port drivers&lt;/a&gt;
-chapter.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk also comes with plugins for the following formats:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;tableblock&#34;&gt;
-&lt;table rules=&#34;all&#34;
-width=&#34;100%&#34;
-frame=&#34;border&#34;
-cellspacing=&#34;0&#34; cellpadding=&#34;4&#34;&gt;
-&lt;col width=&#34;25%&#34; /&gt;
-&lt;col width=&#34;25%&#34; /&gt;
-&lt;col width=&#34;25%&#34; /&gt;
-&lt;col width=&#34;25%&#34; /&gt;
-&lt;thead&gt;
-&lt;tr&gt;
-&lt;th align=&#34;left&#34; valign=&#34;top&#34;&gt; Extension &lt;/th&gt;
-&lt;th align=&#34;center&#34; valign=&#34;top&#34;&gt; Location &lt;/th&gt;
-&lt;th align=&#34;center&#34; valign=&#34;top&#34;&gt; Description &lt;/th&gt;
-&lt;th align=&#34;center&#34; valign=&#34;top&#34;&gt; Output&lt;/th&gt;
-&lt;/tr&gt;
-&lt;/thead&gt;
-&lt;tbody&gt;
-&lt;tr&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;.dtl&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;templates/&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;Django templates&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;ebin/*.beam&lt;/p&gt;&lt;/td&gt;
-&lt;/tr&gt;
-&lt;tr&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;.proto&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;src/&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;Protocol buffers&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;center&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;ebin/*.beam&lt;/p&gt;&lt;/td&gt;
-&lt;/tr&gt;
-&lt;/tbody&gt;
-&lt;/table&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_compilation_options&#34;&gt;Compilation options&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk provides a few variables that you can use to customize
-the build process and the resulting files.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;sect3&#34;&gt;
-&lt;h4 id=&#34;_erlc_opts&#34;&gt;ERLC_OPTS&lt;/h4&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;&lt;code&gt;ERLC_OPTS&lt;/code&gt; can be used to pass some options to &lt;code&gt;erlc&lt;/code&gt;, the Erlang
-compiler. Erlang.mk does not restrict any option. Please refer to
-the &lt;a href=&#34;http://www.erlang.org/doc/man/erlc.html&#34;&gt;erlc Manual&lt;/a&gt; for the
-full list.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;By default, Erlang.mk will set the following options:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;In other words: warnings as errors, debug info (recommended) and
-enable warnings for exported variables, shadow variables and
-obsolete guard functions.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;You can redefine this variable in your Makefile to change it
-completely, either before or after including Erlang.mk:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;You can also filter out some options from the defaults Erlang.mk
-sets, by defining ERLC_OPTS after including Erlang.mk using the
-&lt;code&gt;:=&lt;/code&gt; operator.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect3&#34;&gt;
-&lt;h4 id=&#34;_erlc_exclude&#34;&gt;ERLC_EXCLUDE&lt;/h4&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;&lt;code&gt;ERLC_EXCLUDE&lt;/code&gt; can be used to exclude some modules from the
-compilation. It&amp;#8217;s there for handling special cases, you should
-not normally need it.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To exclude a module, simply list it in the variable, either
-before or after including Erlang.mk:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_cold_and_hot_builds&#34;&gt;Cold and hot builds&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The first time you run &lt;code&gt;make&lt;/code&gt;, Erlang.mk will build everything.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The second time you run &lt;code&gt;make&lt;/code&gt;, and all subsequent times, Erlang.mk
-will only rebuild what changed. Erlang.mk has been optimized for
-this use case, as it is the most common during development.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk figures out what changed by using the dependency tracking
-feature of Make. Make automatically rebuilds a target if one of its
-dependency has changed (for example if a header file has changed,
-all the source files that include it will be rebuilt), and Erlang.mk
-leverages this feature to cut down on rebuild times.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Note that this applies only to building; some other features of
-Erlang.mk will run every time they are called regardless of files
-changed.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_dependency_tracking&#34;&gt;Dependency tracking&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;admonitionblock&#34;&gt;
-&lt;table&gt;&lt;tr&gt;
-&lt;td class=&#34;icon&#34;&gt;
-&lt;div class=&#34;title&#34;&gt;Note&lt;/div&gt;
-&lt;/td&gt;
-&lt;td class=&#34;content&#34;&gt;This section is about the dependency tracking between files
-inside your project, not application dependencies.&lt;/td&gt;
-&lt;/tr&gt;&lt;/table&gt;
-&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk keeps track of the dependencies between the different
-files in your project. This information is kept in the &lt;em&gt;$(PROJECT).d&lt;/em&gt;
-file in your directory. It is generated if missing, and will be
-generated again after every file change, by default.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Dependency tracking is what allows Erlang.mk to know when to
-rebuild Erlang files when header files, behaviors or parse
-transforms have changed. Erlang.mk also automatically keeps
-track of which files should be compiled first, for example
-when you have behaviors used by other modules in your project.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If your project is stable, you may want to disable generating
-the dependency tracking file every time you compile. You can
-do this by adding the following line to your &lt;em&gt;Makefile&lt;/em&gt;:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;As you can see, the snippet above uses &lt;code&gt;?=&lt;/code&gt; instead of a
-simple equal sign. This is to allow you to temporarily override
-this value when you do make substantial changes to your project
-(including a new header file, new module with dependencies, etc.)
-and want to rebuild the dependency tracking file. You&amp;#8217;ll be
-able to use the following command:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ &lt;span style=&#34;color: #009900&#34;&gt;NO_MAKEDEP&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; make&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Otherwise, &lt;code&gt;make clean app&lt;/code&gt; will of course force the
-recompilation of your project.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk can also keep track of the source files generated
-by other means, for example if you generate code from a data
-file in your repository.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_generating_erlang_source&#34;&gt;Generating Erlang source&lt;/h2&gt;
+&lt;h2 id=&#34;plugins&#34;&gt;Third-party plugins&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk provides hooks at different stages of the build process.
-When your goal is to generate Erlang source files, you can
-add your own rules before or after the dependency tracking
-file is generated. To do this, you would add your hook before
-or after including the &lt;em&gt;erlang.mk&lt;/em&gt; file.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The easiest way is after:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;In this case we use &lt;code&gt;$(gen_verbose)&lt;/code&gt; to hide the details of
-the build by default. Erlang.mk will simply say what file
-is it currently generating.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When using an external script to generate the Erlang source
-file, it is recommended to depend on that script, so that
-the source file gets generated again when the script gets
-modified.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If for whatever reason you prefer to hook before including
-Erlang.mk, don&amp;#8217;t forget to set the &lt;code&gt;.DEFAULT_GOAL&lt;/code&gt; variable,
-otherwise nothing will get built:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;external_plugins/&#34;&gt;External plugins&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;external_plugins_list/&#34;&gt;List of plugins&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_cleaning&#34;&gt;Cleaning&lt;/h2&gt;
+&lt;h2 id=&#34;about&#34;&gt;About Erlang.mk&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Building typically involves creating a lot of new files. Some
-are reused in rebuilds, some are simply replaced. All can be
-removed safely.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk provides two commands to remove them: &lt;code&gt;clean&lt;/code&gt; and
-&lt;code&gt;distclean&lt;/code&gt;. &lt;code&gt;clean&lt;/code&gt; removes all the intermediate files that
-were created as a result of building, including the BEAM files,
-the dependency tracking file and the generated documentation.
-&lt;code&gt;distclean&lt;/code&gt; removes these and more, including the downloaded
-dependencies, Dialyzer&amp;#8217;s PLT file and the generated release,
-putting your directory back to the state it was before you
-started working on it.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To clean:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make clean&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Or distclean:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make distclean&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;That is the question.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Note that Erlang.mk will automatically clean some files as
-part of other targets, but it will never run &lt;code&gt;distclean&lt;/code&gt; if
-you don&amp;#8217;t explicitly use it.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;why/&#34;&gt;Why erlang.mk?&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;history/&#34;&gt;Short history&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;contributing/&#34;&gt;Contributing&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
</item>
<item>
- <title>Code coverage</title>
- <link>http://ninenines.eu/docs/en/erlang.mk/1/guide/coverage/</link>
+ <title>Gun Function Reference</title>
+ <link>http://ninenines.eu/docs/en/gun/1.0/manual/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
- <guid>http://ninenines.eu/docs/en/erlang.mk/1/guide/coverage/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Placeholder chapter.&lt;/p&gt;&lt;/div&gt;
+ <guid>http://ninenines.eu/docs/en/gun/1.0/manual/</guid>
+ <description>&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;gun_app&#34;&gt;gun(7)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;gun&#34;&gt;gun(3)&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
</description>
</item>
<item>
- <title>Common Test</title>
- <link>http://ninenines.eu/docs/en/erlang.mk/1/guide/common_test/</link>
+ <title>Gun User Guide</title>
+ <link>http://ninenines.eu/docs/en/gun/1.0/guide/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
- <guid>http://ninenines.eu/docs/en/erlang.mk/1/guide/common_test/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Common Test is Erlang&amp;#8217;s functional testing framework.
-Erlang.mk automates the discovery and running of Common
-Test suites.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_writing_tests&#34;&gt;Writing tests&lt;/h2&gt;
+ <guid>http://ninenines.eu/docs/en/gun/1.0/guide/</guid>
+ <description>&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;introduction/&#34;&gt;Introduction&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;start/&#34;&gt;Starting and stopping&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;protocols/&#34;&gt;Supported protocols&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;connect/&#34;&gt;Connection&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;http/&#34;&gt;Using HTTP&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;websocket/&#34;&gt;Using Websocket&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
+</description>
+ </item>
+
+ <item>
+ <title>HTTP status codes(7)</title>
+ <link>http://ninenines.eu/docs/en/cowboy/2.0/manual/http_status_codes/</link>
+ <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
+
+ <guid>http://ninenines.eu/docs/en/cowboy/2.0/manual/http_status_codes/</guid>
+ <description>&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_name&#34;&gt;Name&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;a href=&#34;http://www.erlang.org/doc/apps/common_test/write_test_chapter.html&#34;&gt;Common Test user guide&lt;/a&gt;
-is the best place to learn how to write tests. Erlang.mk
-requires that file names for test suites end with &lt;em&gt;_SUITE.erl&lt;/em&gt;
-and that the files be located in the &lt;em&gt;$(TEST_DIR)&lt;/em&gt; directory.
-This defaults to &lt;em&gt;test/&lt;/em&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;HTTP status codes - status codes used by Cowboy&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_configuration&#34;&gt;Configuration&lt;/h2&gt;
+&lt;h2 id=&#34;_description&#34;&gt;Description&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;CT_OPTS&lt;/code&gt; variable allows you to set extra Common Test
-options. Options are documented in the
-&lt;a href=&#34;http://www.erlang.org/doc/apps/common_test/run_test_chapter.html&#34;&gt;Common Test user guide&lt;/a&gt;.
-You can use it to set Common Test hooks, for example:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;CT_SUITES&lt;/code&gt; variable can be used to override what
-Common Test suites Erlang.mk will be aware of. It does
-not normally need to be set as Erlang.mk will find the
-test suites automatically.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The name of the suite is the part before &lt;code&gt;_SUITE.erl&lt;/code&gt;.
-If the file is named &lt;em&gt;http_SUITE.erl&lt;/em&gt;, the test suite
-is &lt;code&gt;http&lt;/code&gt;:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This chapter aims to list all HTTP status codes that Cowboy
+may return, with details on the reasons why. The list given
+here only includes the replies that Cowboy sends, not user
+replies.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_usage&#34;&gt;Usage&lt;/h2&gt;
+&lt;h2 id=&#34;_100_continue&#34;&gt;100 Continue&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To run all tests (including Common Test):&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make tests&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To run all tests and static checks (including Common Test):&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make check&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;You can also run Common Test separately:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make ct&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk will create targets for all test suites it finds.
-If you have a file named &lt;em&gt;test/http_SUITE.erl&lt;/em&gt;, then the
-target &lt;code&gt;ct-http&lt;/code&gt; will run that specific test suite:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make ct-http&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk provides a convenient way to run a specific
-group or a specific test case within a specific group,
-using the variable &lt;code&gt;t&lt;/code&gt;. Note that this only applies to
-suite-specific targets, like the &lt;code&gt;ct-http&lt;/code&gt; example above.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To run all tests from the &lt;code&gt;http_compress&lt;/code&gt; group in the
-&lt;code&gt;http_SUITE&lt;/code&gt; test suite, write:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make ct-http &lt;span style=&#34;color: #009900&#34;&gt;t&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt;http_compress&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Similarly, to run a specific test case in that group:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make ct-http &lt;span style=&#34;color: #009900&#34;&gt;t&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt;http_compress&lt;span style=&#34;color: #990000&#34;&gt;:&lt;/span&gt;headers_dupe&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To do the same against a multi-application repository,
-you can use the &lt;code&gt;-C&lt;/code&gt; option:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make -C apps/my_app ct-http &lt;span style=&#34;color: #009900&#34;&gt;t&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt;my_group&lt;span style=&#34;color: #990000&#34;&gt;:&lt;/span&gt;my_case&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Note that this also applies to dependencies. When using Cowboy
-as a dependency, you can run the following directly:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make -C deps/cowboy ct-http &lt;span style=&#34;color: #009900&#34;&gt;t&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt;http_compress&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Finally, &lt;a href=&#34;../coverage&#34;&gt;code coverage&lt;/a&gt; is available,
-but covered in its own chapter.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When the client sends an &lt;code&gt;expect: 100-continue&lt;/code&gt; header,
+Cowboy automatically sends a this status code before
+trying to read the request body. This behavior can be
+disabled using the appropriate body option.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
-</description>
- </item>
-
- <item>
- <title>Compatibility with other build tools</title>
- <link>http://ninenines.eu/docs/en/erlang.mk/1/guide/compat/</link>
- <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
-
- <guid>http://ninenines.eu/docs/en/erlang.mk/1/guide/compat/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk tries its best to be compatible with the other Erlang
-build tools. It can use dependencies written with other build
-tools in mind, and can also make your projects usable by those
-build tools as well. Erlang.mk is like the cool kid that gets
-along with everybody.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;In this chapter I will use the term &lt;em&gt;Rebar project&lt;/em&gt; to refer
-to a project built using Rebar 2, Rebar 3 or Mad. These three
-build tools are very similar and share the same configuration
-file.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_rebar_projects_as_erlang_mk_dependencies&#34;&gt;Rebar projects as Erlang.mk dependencies&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk comes with a feature called &lt;em&gt;Autoload&lt;/em&gt; which will
-use Rebar 2 to patch any Rebar project and make it compatible
-with Erlang.mk. This feature essentially patches Rebar out
-and adds a Makefile to the project that Erlang.mk can then
-use for building:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;&lt;em&gt;Autoload&lt;/em&gt; is documented in more details in the
-&lt;a href=&#34;../deps&#34;&gt;Packages and dependencies&lt;/a&gt; chapter.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_erlang_mk_projects_as_rebar_dependencies&#34;&gt;Erlang.mk projects as Rebar dependencies&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk projects can be made compatible with the Rebar family
-of build tools pretty easily, as Erlang.mk will generate
-all the files they require for building.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The Rebar family requires two files: a &lt;em&gt;rebar.config&lt;/em&gt; file
-containing compilation options and the list of dependencies,
-and the application resource file, found either at
-&lt;em&gt;ebin/$(PROJECT).app&lt;/em&gt; or at &lt;em&gt;src/$(PROJECT).app.src&lt;/em&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;sect3&#34;&gt;
-&lt;h4 id=&#34;_rebar_configuration&#34;&gt;Rebar configuration&lt;/h4&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk comes with a target that generates a &lt;em&gt;rebar.config&lt;/em&gt;
-file when invoked:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make rebar&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;config&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Careful! This will build the file even if it already existed
-before.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To build this file, Erlang.mk uses information it finds in
-the &lt;code&gt;DEPS&lt;/code&gt; and &lt;code&gt;ERLC_OPTS&lt;/code&gt; variables, among others. This
-means that the Rebar family builds your project much the
-same way as Erlang.mk.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Careful though! Different build tools have different fetching
-strategies. If some applications provide differing dependencies,
-they might be fetched differently by other build tools. Check
-the upcoming Sanity check chapter to find out how to detect such
-issues.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;You can automatically generate this file when you build
-your application, by making it a dependency of the &lt;code&gt;app&lt;/code&gt;
-target:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Don&amp;#8217;t forget to commit the file when it changes!&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you run into other issues, it&amp;#8217;s probably because you use a
-feature specific to Erlang.mk, like the &lt;code&gt;cp&lt;/code&gt; fetch method.
-It could also be that we forgot to handle something! Sorry.
-We are of course interested to hear about any compatibility
-problems you may have, just open a ticket!&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect3&#34;&gt;
-&lt;h4 id=&#34;_application_resource_file&#34;&gt;Application resource file&lt;/h4&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk has two ways to generate an application resource
-file: from the information found in the Makefile, or from
-the information found in the &lt;em&gt;src/$(PROJECT).app.src&lt;/em&gt; file.
-Needless to say, if you have this file in your repository,
-then you don&amp;#8217;t need to worry about compatibility with other
-build tools.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you don&amp;#8217;t, however, it&amp;#8217;s not much harder. Every time
-Erlang.mk will compile your application, it will produce
-a new &lt;em&gt;ebin/$(PROJECT).app&lt;/em&gt; file. Simply commit this file
-when it changes. It will only change when you modify the
-configuration, add or remove modules.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_101_switching_protocols&#34;&gt;101 Switching Protocols&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This is the status code sent when switching to the
+Websocket protocol.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_200_ok&#34;&gt;200 OK&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
&lt;/div&gt;
-</description>
- </item>
-
- <item>
- <title>Connection</title>
- <link>http://ninenines.eu/docs/en/gun/1.0/guide/connect/</link>
- <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
-
- <guid>http://ninenines.eu/docs/en/gun/1.0/guide/connect/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This chapter describes how to open, monitor and close
-a connection using the Gun client.&lt;/p&gt;&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_gun_connections&#34;&gt;Gun connections&lt;/h2&gt;
+&lt;h2 id=&#34;_201_created&#34;&gt;201 Created&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Gun is designed with the SPDY 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.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;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 &lt;em&gt;owner&lt;/em&gt; of the connection, and is
-managed by the supervision tree of the &lt;code&gt;gun&lt;/code&gt; application.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The owner process communicates with the Gun connection
-by calling functions from the module &lt;code&gt;gun&lt;/code&gt;. All functions
-perform their respective operations asynchronously. The Gun
-connection will send Erlang messages to the owner process
-whenever needed.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When the remote endpoint closes the connection, Gun attempts
-to reconnect automatically.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_opening_a_new_connection&#34;&gt;Opening a new connection&lt;/h2&gt;
+&lt;h2 id=&#34;_202_accepted&#34;&gt;202 Accepted&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;gun:open/{2,3}&lt;/code&gt; function must be used to open a connection.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;title&#34;&gt;Opening a connection to example.org on port 443&lt;/div&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;{&lt;span style=&#34;color: #FF6600&#34;&gt;ok&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;ConnPid&lt;/span&gt;} &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;gun:open&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #FF0000&#34;&gt;&#34;example.org&#34;&lt;/span&gt;, &lt;span style=&#34;color: #993399&#34;&gt;443&lt;/span&gt;)&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;For any other port, Gun will attempt to connect using TCP
-and will use the HTTP/1.1 protocol.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The transport and protocol used can be overriden using
-options. The manual documents all available options.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Options can be provided as a third argument, and take the
-form of a map.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;title&#34;&gt;Opening an SSL connection to example.org on port 8443&lt;/div&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;{&lt;span style=&#34;color: #FF6600&#34;&gt;ok&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;ConnPid&lt;/span&gt;} &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;gun:open&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #FF0000&#34;&gt;&#34;example.org&#34;&lt;/span&gt;, &lt;span style=&#34;color: #993399&#34;&gt;8443&lt;/span&gt;, #{&lt;span style=&#34;color: #0000FF&#34;&gt;transport&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span style=&#34;color: #FF6600&#34;&gt;ssl&lt;/span&gt;})&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_waiting_for_the_connection_to_be_established&#34;&gt;Waiting for the connection to be established&lt;/h2&gt;
+&lt;h2 id=&#34;_204_no_content&#34;&gt;204 No Content&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When Gun successfully connects to the server, it sends a
-&lt;code&gt;gun_up&lt;/code&gt; message with the protocol that has been selected
-for the connection.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Gun provides the functions &lt;code&gt;gun:await_up/{1,2,3}&lt;/code&gt; that wait
-for the &lt;code&gt;gun_up&lt;/code&gt; 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.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;title&#34;&gt;Synchronous opening of a connection&lt;/div&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;{&lt;span style=&#34;color: #FF6600&#34;&gt;ok&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;ConnPid&lt;/span&gt;} &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;gun:open&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #FF0000&#34;&gt;&#34;example.org&#34;&lt;/span&gt;, &lt;span style=&#34;color: #993399&#34;&gt;443&lt;/span&gt;),
-{&lt;span style=&#34;color: #FF6600&#34;&gt;ok&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Protocol&lt;/span&gt;} &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;gun:await_up&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #009900&#34;&gt;ConnPid&lt;/span&gt;)&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent when the processing of a request
+ends without any reply having been sent. It may also be
+sent by &lt;code&gt;cowboy_rest&lt;/code&gt; under normal conditions.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_handling_connection_loss&#34;&gt;Handling connection loss&lt;/h2&gt;
+&lt;h2 id=&#34;_300_multiple_choices&#34;&gt;300 Multiple Choices&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When the connection is lost, Gun will send a &lt;code&gt;gun_down&lt;/code&gt;
-message indicating the current protocol, the reason the
-connection was lost and two list of stream references.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The first list indicates open streams that &lt;em&gt;may&lt;/em&gt; have been
-processed by the server. The second list indicates open
-streams that the server did not process.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_monitoring_the_connection_process&#34;&gt;Monitoring the connection process&lt;/h2&gt;
+&lt;h2 id=&#34;_301_moved_permanently&#34;&gt;301 Moved Permanently&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;@todo Gun should detect the owner process being killed&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Because software errors are unavoidable, it is important to
-detect when the Gun process crashes. It is also important
-to detect when it exits normally. Erlang provides two ways
-to do that: links and monitors.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Gun leaves you the choice as to which one will be used.
-However, if you use the &lt;code&gt;gun:await/{2,3}&lt;/code&gt; or &lt;code&gt;gun:await_body/{2,3}&lt;/code&gt;
-functions, a monitor may be used for you to avoid getting
-stuck waiting for a message that will never come.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;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 &lt;code&gt;gun:await/{3,4}&lt;/code&gt; and &lt;code&gt;gun:await_body/{3,4}&lt;/code&gt;
-functions both accept a monitor argument if you have one already.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;title&#34;&gt;Monitoring the connection process&lt;/div&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;{&lt;span style=&#34;color: #FF6600&#34;&gt;ok&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;ConnPid&lt;/span&gt;} &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;gun:open&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #FF0000&#34;&gt;&#34;example.org&#34;&lt;/span&gt;, &lt;span style=&#34;color: #993399&#34;&gt;443&lt;/span&gt;)&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;
-&lt;span style=&#34;color: #009900&#34;&gt;MRef&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;monitor&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000080&#34;&gt;process&lt;/span&gt;&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;ConnPid&lt;/span&gt;)&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This monitor reference can be kept and used until the connection
-process exits.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;title&#34;&gt;Handling &lt;code&gt;DOWN&lt;/code&gt; messages&lt;/div&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;receive&lt;/span&gt;&lt;/span&gt;
- &lt;span style=&#34;font-style: italic&#34;&gt;&lt;span style=&#34;color: #9A1900&#34;&gt;%% Receive Gun messages here...&lt;/span&gt;&lt;/span&gt;
- {&lt;span style=&#34;color: #FF6600&#34;&gt;&#39;DOWN&#39;&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Mref&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000080&#34;&gt;process&lt;/span&gt;&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;ConnPid&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Reason&lt;/span&gt;} &lt;span style=&#34;color: #990000&#34;&gt;-&amp;gt;&lt;/span&gt;
- &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;error_logger:error_msg&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #FF0000&#34;&gt;&#34;Oops!&#34;&lt;/span&gt;),
- &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000080&#34;&gt;exit&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #009900&#34;&gt;Reason&lt;/span&gt;);
-&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;What to do when you receive a &lt;code&gt;DOWN&lt;/code&gt; message is entirely up to you.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_closing_the_connection_abruptly&#34;&gt;Closing the connection abruptly&lt;/h2&gt;
+&lt;h2 id=&#34;_303_see_other&#34;&gt;303 See Other&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The connection can be stopped abruptly at any time by calling
-the &lt;code&gt;gun:close/1&lt;/code&gt; function.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;title&#34;&gt;Immediate closing of the connection&lt;/div&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;gun:close&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #009900&#34;&gt;ConnPid&lt;/span&gt;)&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The process is stopped immediately without having a chance to
-perform the protocol&amp;#8217;s closing handshake, if any.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_closing_the_connection_gracefully&#34;&gt;Closing the connection gracefully&lt;/h2&gt;
+&lt;h2 id=&#34;_304_not_modified&#34;&gt;304 Not Modified&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The connection can also be stopped gracefully by calling the
-&lt;code&gt;gun:shutdown/1&lt;/code&gt; function.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;title&#34;&gt;Graceful shutdown of the connection&lt;/div&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;gun:shutdown&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #009900&#34;&gt;ConnPid&lt;/span&gt;)&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Gun will refuse any new requests or messages after you call
-this function. It will however continue to send you messages
-for existing streams until they are all completed.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;For example if you performed a GET request just before calling
-&lt;code&gt;gun:shutdown/1&lt;/code&gt;, you will still receive the response before
-Gun closes the connection.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you set a monitor beforehand, you will receive a message
-when the connection has been closed.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
-</description>
- </item>
-
- <item>
- <title>Constraints</title>
- <link>http://ninenines.eu/docs/en/cowboy/2.0/guide/constraints/</link>
- <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
-
- <guid>http://ninenines.eu/docs/en/cowboy/2.0/guide/constraints/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Constraints are validation and conversion functions applied
-to user input.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;They are used in various places in Cowboy, including the
-router and the request match functions.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_syntax&#34;&gt;Syntax&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Constraints are provided as a list of fields. For each field
-in the list, specific constraints can be applied, as well as
-a default value if the field is missing.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;A field can take the form of an atom &lt;code&gt;field&lt;/code&gt;, a tuple with
-constraints &lt;code&gt;{field, Constraints}&lt;/code&gt; or a tuple with constraints
-and a default value &lt;code&gt;{field, Constraints, Default}&lt;/code&gt;.
-The &lt;code&gt;field&lt;/code&gt; form indicates the field is mandatory.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Note that when used with the router, only the second form
-makes sense, as it does not use the default and the field
-is always defined.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Constraints for each field are provided as an ordered list
-of atoms or funs to apply. Built-in constraints are provided
-as atoms, while custom constraints are provided as funs.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When multiple constraints are provided, they are applied in
-the order given. If the value has been modified by a constraint
-then the next one receives the new value.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;For example, the following constraints will first validate
-and convert the field &lt;code&gt;my_value&lt;/code&gt; to an integer, and then
-check that the integer is positive:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;color: #009900&#34;&gt;PositiveFun&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;fun&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #009900&#34;&gt;V&lt;/span&gt;) &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;when&lt;/span&gt;&lt;/span&gt; &lt;span style=&#34;color: #009900&#34;&gt;V&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #993399&#34;&gt;0&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #000080&#34;&gt;true&lt;/span&gt;; (&lt;span style=&#34;color: #990000&#34;&gt;_&lt;/span&gt;) &lt;span style=&#34;color: #990000&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #000080&#34;&gt;false&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;end&lt;/span&gt;&lt;/span&gt;,
-{&lt;span style=&#34;color: #FF6600&#34;&gt;my_value&lt;/span&gt;, [&lt;span style=&#34;color: #FF6600&#34;&gt;int&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;PositiveFun&lt;/span&gt;]}&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When there&amp;#8217;s only one constraint, it can be provided directly
-without wrapping it into a list:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;{&lt;span style=&#34;color: #FF6600&#34;&gt;my_value&lt;/span&gt;, &lt;span style=&#34;color: #FF6600&#34;&gt;int&lt;/span&gt;}&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_built_in_constraints&#34;&gt;Built-in constraints&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Built-in constraints are specified as an atom:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;tableblock&#34;&gt;
-&lt;table rules=&#34;all&#34;
-width=&#34;100%&#34;
-frame=&#34;border&#34;
-cellspacing=&#34;0&#34; cellpadding=&#34;4&#34;&gt;
-&lt;col width=&#34;50%&#34; /&gt;
-&lt;col width=&#34;50%&#34; /&gt;
-&lt;thead&gt;
-&lt;tr&gt;
-&lt;th align=&#34;left&#34; valign=&#34;top&#34;&gt; Constraint &lt;/th&gt;
-&lt;th align=&#34;left&#34; valign=&#34;top&#34;&gt; Description&lt;/th&gt;
-&lt;/tr&gt;
-&lt;/thead&gt;
-&lt;tbody&gt;
-&lt;tr&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;int&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;Converts binary value to integer.&lt;/p&gt;&lt;/td&gt;
-&lt;/tr&gt;
-&lt;tr&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;nonempty&lt;/p&gt;&lt;/td&gt;
-&lt;td align=&#34;left&#34; valign=&#34;top&#34;&gt;&lt;p class=&#34;table&#34;&gt;Ensures the binary value is non-empty.&lt;/p&gt;&lt;/td&gt;
-&lt;/tr&gt;
-&lt;/tbody&gt;
-&lt;/table&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_custom_constraints&#34;&gt;Custom constraints&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Custom constraints are specified as a fun. This fun takes
-a single argument and must return one of &lt;code&gt;true&lt;/code&gt;, &lt;code&gt;{true, NewValue}&lt;/code&gt;
-or &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;&lt;code&gt;true&lt;/code&gt; indicates the input is valid, &lt;code&gt;false&lt;/code&gt; otherwise.
-The &lt;code&gt;{true, NewValue}&lt;/code&gt; tuple is returned when the input
-is valid and the value has been converted. For example,
-the following constraint will convert the binary input
-to an integer:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;fun&lt;/span&gt;&lt;/span&gt; (&lt;span style=&#34;color: #009900&#34;&gt;Value0&lt;/span&gt;) &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;when&lt;/span&gt;&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000080&#34;&gt;is_binary&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #009900&#34;&gt;Value0&lt;/span&gt;) &lt;span style=&#34;color: #990000&#34;&gt;-&amp;gt;&lt;/span&gt;
- &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;try&lt;/span&gt;&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;binary_to_integer&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #009900&#34;&gt;Value0&lt;/span&gt;) &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;of&lt;/span&gt;&lt;/span&gt;
- &lt;span style=&#34;color: #009900&#34;&gt;Value&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;-&amp;gt;&lt;/span&gt; {&lt;span style=&#34;color: #000080&#34;&gt;true&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Value&lt;/span&gt;}
- &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;catch&lt;/span&gt;&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;_:_&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;-&amp;gt;&lt;/span&gt;
- &lt;span style=&#34;color: #000080&#34;&gt;false&lt;/span&gt;
- &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #0000FF&#34;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Constraint functions should only crash because the programmer
-made an error when chaining constraints incorrectly (for example
-if the constraints were &lt;code&gt;[int, int]&lt;/code&gt;, and not because of input.
-If the input is invalid then &lt;code&gt;false&lt;/code&gt; must be returned.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;In our snippet, the &lt;code&gt;is_binary/1&lt;/code&gt; guard will crash only
-because of a programmer error, and the try block is there
-to ensure that we do not crash when the input is invalid.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_307_temporary_redirect&#34;&gt;307 Temporary Redirect&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
-</description>
- </item>
-
- <item>
- <title>Continuous integration</title>
- <link>http://ninenines.eu/docs/en/erlang.mk/1/guide/ci/</link>
- <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
-
- <guid>http://ninenines.eu/docs/en/erlang.mk/1/guide/ci/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Placeholder chapter.&lt;/p&gt;&lt;/div&gt;
-</description>
- </item>
-
- <item>
- <title>Contributing</title>
- <link>http://ninenines.eu/docs/en/erlang.mk/1/guide/contributing/</link>
- <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
-
- <guid>http://ninenines.eu/docs/en/erlang.mk/1/guide/contributing/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;You are welcome and encouraged to contribute.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This is how.&lt;/p&gt;&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_priorities&#34;&gt;Priorities&lt;/h2&gt;
+&lt;h2 id=&#34;_400_bad_request&#34;&gt;400 Bad Request&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;From the most important to the least important:&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy will send this status code for any of the
+following reasons:&lt;/p&gt;&lt;/div&gt;
&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
-Bugs
+Too many empty lines were sent before the request.
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+The request-line could not be parsed.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-Package issues/additions
+Too many headers were sent.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-Refactoring
+A header name was too long.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-Features
+A header value was too long.
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+The host header was missing from an HTTP/1.1 request.
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+The host header could not be parsed.
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+The requested host was not found.
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+The requested path could not be parsed.
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+The accept header could not be parsed when using REST.
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+REST under normal conditions.
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+A Websocket upgrade failed.
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_bugs&#34;&gt;Bugs&lt;/h2&gt;
+&lt;h2 id=&#34;_401_unauthorized&#34;&gt;401 Unauthorized&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you have found a bug, you should open a ticket. Include
-everything relevant including the command you used, output,
-a link to the code that triggers the issue, why you think
-this is a bug, etc.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you think you have found a bug but you are not sure, you
-should open a ticket as previously explained.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you have found a bug and you need it to be solved RIGHT
-NOW, open a ticket as previously explained.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Once you have opened a ticket, be patient, try to answer
-questions in a timely manner and confirm that the bug was
-indeed fixed when it is.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you can&amp;#8217;t be patient, either try to solve the bug and
-contribute the fix back or become a paying customer.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_code&#34;&gt;Code&lt;/h2&gt;
+&lt;h2 id=&#34;_403_forbidden&#34;&gt;403 Forbidden&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The code is located in the &lt;em&gt;core/*.mk&lt;/em&gt; and &lt;em&gt;plugins/*.mk&lt;/em&gt; files.
-The tests are located in the &lt;em&gt;test/Makefile&lt;/em&gt; and &lt;em&gt;test/*.mk&lt;/em&gt; files.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you have a fix or a hack for a bug, you should open a
-pull request. Any fix should include a test case that fails
-before the fix and is working after.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you have a test case that reproduces a bug, but no fix for
-it, you should open a pull request.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Changes need to be tested with at least the &lt;code&gt;make check&lt;/code&gt;
-command. A specific test case can be tested using &lt;code&gt;make check c=CASE&lt;/code&gt;
-with &lt;code&gt;CASE&lt;/code&gt; the name of the target to run. Output can be
-modulated using the &lt;code&gt;V&lt;/code&gt; variable, which is an integer
-from 0 to 4. A typical use would be &lt;code&gt;make check c=dialyzer V=3&lt;/code&gt;.
-The value 4 is particular and shows expanded commands right
-before they are executed.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To run tests in parallel, use the &lt;code&gt;-j&lt;/code&gt; option. It is generally
-a good idea to also use the &lt;code&gt;-k&lt;/code&gt; option to run all tests even
-if one fails. For example: &lt;code&gt;make check -j 32 -k&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Some changes should be tested against all packages. Continue
-reading for more details on testing them.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_packages&#34;&gt;Packages&lt;/h2&gt;
+&lt;h2 id=&#34;_404_not_found&#34;&gt;404 Not Found&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;You can search existing packages using the &lt;code&gt;make search q=STRING&lt;/code&gt;
-command. This can be done both from an Erlang.mk project or
-directly from the Erlang.mk repository.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Packages can be added to the index using the &lt;code&gt;pkg_add.sh&lt;/code&gt; script.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ git clone https&lt;span style=&#34;color: #990000&#34;&gt;:&lt;/span&gt;//github&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;com&lt;span style=&#34;color: #990000&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color: #009900&#34;&gt;$YOURUSERNAME&lt;/span&gt;/erlang&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;mk
-$ cd erlang&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;mk
-$ &lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;/pkg_add&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;sh cowboy git https&lt;span style=&#34;color: #990000&#34;&gt;:&lt;/span&gt;//github&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;com/ninenines/cowboy &lt;span style=&#34;color: #993399&#34;&gt;1.0&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color: #993399&#34;&gt;0&lt;/span&gt;
- http&lt;span style=&#34;color: #990000&#34;&gt;:&lt;/span&gt;//ninenines&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;eu &lt;span style=&#34;color: #FF0000&#34;&gt;&#34;Small, fast and modular HTTP server.&#34;&lt;/span&gt;
-$ git push origin master&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Before sending a pull request, you should test your package.
-You can use the following command: &lt;code&gt;make check p=PACKAGE&lt;/code&gt;,
-where &lt;code&gt;PACKAGE&lt;/code&gt; is the name of the package, for example
-&lt;code&gt;cowboy&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To test all packages, the &lt;code&gt;make packages&lt;/code&gt; command can be used.
-This can take a long time. Some packages will fail with certain
-versions of Erlang, or if a prerequisite is missing from your system.
-You can of course speed things up using the &lt;code&gt;-j&lt;/code&gt; and &lt;code&gt;-k&lt;/code&gt; flags.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;After all packages have been tested, you can run the command
-&lt;code&gt;make summary&lt;/code&gt; to know what changed since the previous run.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent when the router successfully
+resolved the host but didn&amp;#8217;t find a matching path for
+the request. It may also be sent by &lt;code&gt;cowboy_rest&lt;/code&gt; under
+normal conditions.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_405_method_not_allowed&#34;&gt;405 Method Not Allowed&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_406_not_acceptable&#34;&gt;406 Not Acceptable&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_408_request_timeout&#34;&gt;408 Request Timeout&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy will send this status code to the client if the
+client started to send a request, indicated by the
+request-line being received fully, but failed to send
+all headers in a reasonable time.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_documentation&#34;&gt;Documentation&lt;/h2&gt;
+&lt;h2 id=&#34;_409_conflict&#34;&gt;409 Conflict&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The documentation is always right.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you think you have found a mistake in the documentation,
-this is a bug. You can either open a ticket or send a pull
-request.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To make sure that the documentation changes work, install
-the listed &lt;a href=&#34;../asciidoc&#34;&gt;Requirements&lt;/a&gt; on your system and
-run &lt;code&gt;make docs&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_feature_requests&#34;&gt;Feature requests&lt;/h2&gt;
+&lt;h2 id=&#34;_410_gone&#34;&gt;410 Gone&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you have an awesome idea or need something that Erlang.mk
-doesn&amp;#8217;t provide yet, open a ticket. Provide as much detail as
-possible.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you have code, great! Open a pull request as previously
-explained.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If not, you can still improve your feature request by writing
-the related documentation.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_412_precondition_failed&#34;&gt;412 Precondition Failed&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_413_request_entity_too_large&#34;&gt;413 Request Entity Too Large&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_414_request_uri_too_long&#34;&gt;414 Request-URI Too Long&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy will send this status code to the client if the
+request-line is too long. It may also be sent by
+&lt;code&gt;cowboy_rest&lt;/code&gt; under normal conditions.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_415_unsupported_media_type&#34;&gt;415 Unsupported Media Type&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_500_internal_server_error&#34;&gt;500 Internal Server Error&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent when a crash occurs in HTTP, loop
+or REST handlers, or when an invalid return value is
+returned. It may also be sent by &lt;code&gt;cowboy_rest&lt;/code&gt; under
+normal conditions.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_501_not_implemented&#34;&gt;501 Not Implemented&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_503_service_unavailable&#34;&gt;503 Service Unavailable&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This status code is sent by &lt;code&gt;cowboy_rest&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_505_http_version_not_supported&#34;&gt;505 HTTP Version Not Supported&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy only supports the versions 1.0 and 1.1 of HTTP.
+In all other cases this status code is sent back to the
+client and the connection is closed.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
</item>
<item>
- <title>Cowboy Function Reference</title>
- <link>http://ninenines.eu/docs/en/cowboy/2.0/manual/</link>
+ <title>Ranch Function Reference</title>
+ <link>http://ninenines.eu/docs/en/ranch/1.2/manual/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
- <guid>http://ninenines.eu/docs/en/cowboy/2.0/manual/</guid>
+ <guid>http://ninenines.eu/docs/en/ranch/1.2/manual/</guid>
<description>&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_app&#34;&gt;cowboy(7)&lt;/a&gt;
+&lt;a href=&#34;ranch_app&#34;&gt;ranch(7)&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy&#34;&gt;cowboy(3)&lt;/a&gt;
+&lt;a href=&#34;ranch&#34;&gt;ranch(3)&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_handler&#34;&gt;cowboy_handler(3)&lt;/a&gt;
+&lt;a href=&#34;ranch_protocol&#34;&gt;ranch_protocol(3)&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_loop&#34;&gt;cowboy_loop(3)&lt;/a&gt;
+&lt;a href=&#34;ranch_ssl&#34;&gt;ranch_ssl(3)&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_middleware&#34;&gt;cowboy_middleware(3)&lt;/a&gt;
+&lt;a href=&#34;ranch_tcp&#34;&gt;ranch_tcp(3)&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_protocol&#34;&gt;cowboy_protocol(3)&lt;/a&gt;
+&lt;a href=&#34;ranch_transport&#34;&gt;ranch_transport(3)&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
+&lt;/ul&gt;&lt;/div&gt;
+</description>
+ </item>
+
+ <item>
+ <title>Ranch User Guide</title>
+ <link>http://ninenines.eu/docs/en/ranch/1.2/guide/</link>
+ <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
+
+ <guid>http://ninenines.eu/docs/en/ranch/1.2/guide/</guid>
+ <description>&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_req&#34;&gt;cowboy_req(3)&lt;/a&gt;
+&lt;a href=&#34;introduction/&#34;&gt;Introduction&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_rest&#34;&gt;cowboy_rest(3)&lt;/a&gt;
+&lt;a href=&#34;listeners/&#34;&gt;Listeners&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_router&#34;&gt;cowboy_router(3)&lt;/a&gt;
+&lt;a href=&#34;transports/&#34;&gt;Transports&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_static&#34;&gt;cowboy_static(3)&lt;/a&gt;
+&lt;a href=&#34;protocols/&#34;&gt;Protocols&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_sub_protocol&#34;&gt;cowboy_sub_protocol(3)&lt;/a&gt;
+&lt;a href=&#34;embedded/&#34;&gt;Embedded mode&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;cowboy_websocket&#34;&gt;cowboy_websocket(3)&lt;/a&gt;
+&lt;a href=&#34;parsers/&#34;&gt;Writing parsers&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
-&lt;a href=&#34;http_status_codes&#34;&gt;HTTP status codes(7)&lt;/a&gt;
+&lt;a href=&#34;ssl_auth/&#34;&gt;SSL client authentication&lt;/a&gt;
+&lt;/p&gt;
+&lt;/li&gt;
+&lt;li&gt;
+&lt;p&gt;
+&lt;a href=&#34;internals/&#34;&gt;Internals&lt;/a&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
@@ -1412,580 +895,1016 @@ the related documentation.&lt;/p&gt;&lt;/div&gt;
</item>
<item>
- <title>Cowboy User Guide</title>
- <link>http://ninenines.eu/docs/en/cowboy/2.0/guide/</link>
+ <title>Request overview</title>
+ <link>http://ninenines.eu/docs/en/cowboy/2.0/guide/overview/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
- <guid>http://ninenines.eu/docs/en/cowboy/2.0/guide/</guid>
+ <guid>http://ninenines.eu/docs/en/cowboy/2.0/guide/overview/</guid>
+ <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This chapter explains the different steps a request
+goes through until a response is sent, along with
+details of the Cowboy implementation.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_request_response&#34;&gt;Request/response&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;As you already know, HTTP clients connect to the server and
+send a request for a resource; the server then sends a
+response containing the resource if it could obtain it.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Before the server can send the resource, however, it
+needs to perform many different operations to read the
+request, find the resource, prepare the response being
+sent and often other related operations the user can
+add like writing logs.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Requests take the following route in Cowboy:&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;imageblock&#34;&gt;
+&lt;div class=&#34;content&#34;&gt;
+&lt;img src=&#34;../http_req_resp.png&#34; alt=&#34;HTTP request/response flowchart&#34; /&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This shows the default middlewares, but they may be
+configured differently in your setup. The dark green
+indicates the points where you can hook your own code,
+the light green is the Cowboy code that you can of
+course configure as needed.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;acceptor&lt;/code&gt; is the part of the server that accepts
+the connection and create an Erlang process to handle
+it. The &lt;code&gt;parser&lt;/code&gt; then starts reading from the socket
+and handling requests as they come until the socket
+is closed.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;A response may be sent at many different points in the
+life of the request. If Cowboy can&amp;#8217;t parse the request,
+it gives up with an error response. If the router can&amp;#8217;t
+find the resource, it sends a not found error. Your
+own code can of course send a response at any time.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When a response is sent, you can optionally modify it
+or act upon it by enabling the &lt;code&gt;onresponse&lt;/code&gt; hook. By
+default the response is sent directly to the client.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_and_then&#34;&gt;And then?&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Behavior depends on what protocol is in use.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;HTTP/1.0 can only process one request per connection,
+so Cowboy will close the connection immediately after
+it sends the response.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;HTTP/1.1 allows the client to request that the server
+keeps the connection alive. This mechanism is described
+in the next section.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;HTTP/2 is designed to allow sending multiple requests
+asynchronously on the same connection. Details on what
+this means for your application is described in this
+chapter.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_keep_alive_http_1_1&#34;&gt;Keep-alive (HTTP/1.1)&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;With HTTP/1.1, the connection may be left open for
+subsequent requests to come. This mechanism is called
+&lt;code&gt;keep-alive&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When the client sends a request to the server, it includes
+a header indicating whether it would like to leave the
+socket open. The server may or may not accept, indicating
+its choice by sending the same header in the response.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy will include this header automatically in all
+responses to HTTP/1.1 requests. You can however force
+the closing of the socket if you want. When Cowboy sees
+you want to send a &lt;code&gt;connection: close&lt;/code&gt; header, it will
+not override it and will close the connection as soon
+as the reply is sent.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This snippet will force Cowboy to close the connection.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;listingblock&#34;&gt;
+&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite --&gt;
+&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;color: #009900&#34;&gt;Req2&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy_req:reply&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #993399&#34;&gt;200&lt;/span&gt;, [
+ {&lt;span style=&#34;color: #990000&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color: #FF0000&#34;&gt;&#34;connection&#34;&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;&amp;gt;&amp;gt;&lt;/span&gt;, &lt;span style=&#34;color: #990000&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color: #FF0000&#34;&gt;&#34;close&#34;&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;&amp;gt;&amp;gt;&lt;/span&gt;},
+], &lt;span style=&#34;color: #990000&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color: #FF0000&#34;&gt;&#34;Closing the socket in 3.. 2.. 1..&#34;&lt;/span&gt;&lt;span style=&#34;color: #990000&#34;&gt;&amp;gt;&amp;gt;&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Req&lt;/span&gt;)&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy will only accept a certain number of new requests
+on the same connection. By default it will run up to 100
+requests. This number can be changed by setting the
+&lt;code&gt;max_keepalive&lt;/code&gt; configuration value when starting an
+HTTP listener.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;listingblock&#34;&gt;
+&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite --&gt;
+&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy:start_http&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #FF6600&#34;&gt;my_http_listener&lt;/span&gt;, &lt;span style=&#34;color: #993399&#34;&gt;100&lt;/span&gt;, [{&lt;span style=&#34;color: #FF6600&#34;&gt;port&lt;/span&gt;, &lt;span style=&#34;color: #993399&#34;&gt;8080&lt;/span&gt;}], [
+ {&lt;span style=&#34;color: #FF6600&#34;&gt;env&lt;/span&gt;, [{&lt;span style=&#34;color: #FF6600&#34;&gt;dispatch&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Dispatch&lt;/span&gt;}]},
+ {&lt;span style=&#34;color: #FF6600&#34;&gt;max_keepalive&lt;/span&gt;, &lt;span style=&#34;color: #993399&#34;&gt;5&lt;/span&gt;}
+])&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy implements the keep-alive mechanism by reusing
+the same process for all requests. This allows Cowboy
+to save memory. This works well because most code will
+not have any side effect impacting subsequent requests.
+But it also means you need to clean up if you do have
+code with side effects. The &lt;code&gt;terminate/3&lt;/code&gt; function can
+be used for this purpose.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_pipelining_http_1_1&#34;&gt;Pipelining (HTTP/1.1)&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;While HTTP is designed as a sequential protocol, with
+the client sending a request and then waiting for the
+response from the server, nothing prevents the client
+from sending more requests to the server without waiting
+for the response, due to how sockets work. The server
+still handles the requests sequentially and sends the
+responses in the same order.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This mechanism is called pipelining. It allows reducing
+latency when a client needs to request many resources
+at the same time. This is used by browsers when requesting
+static files for example.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This is handled automatically by the server.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_asynchronous_requests_http_2&#34;&gt;Asynchronous requests (HTTP/2)&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;In HTTP/2, the client can send a request at any time.
+And the server can send a response at any time too.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This means for example that the client does not need
+to wait for a request to be fully sent to send another,
+it is possible to interleave a request with the request
+body of another request. The same is true with responses.
+Responses may also be sent in a different order.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Because requests and responses are fully asynchronous,
+Cowboy creates a new process for each request, and these
+processes are managed by another process that handles the
+connection itself.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;HTTP/2 servers may also decide to send resources to the
+client before the client requests them. This is especially
+useful for sending static files associated with the HTML
+page requested, as this reduces the latency of the overall
+response. Cowboy does not support this particular mechanism
+at this point, however.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+</description>
+ </item>
+
+ <item>
+ <title>cowboy(3)</title>
+ <link>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy/</link>
+ <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
+
+ <guid>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy/</guid>
<description>&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_rationale&#34;&gt;Rationale&lt;/h2&gt;
+&lt;h2 id=&#34;_name&#34;&gt;Name&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
-&lt;p&gt;
-&lt;a href=&#34;modern_web/&#34;&gt;The modern Web&lt;/a&gt;
-&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
-&lt;p&gt;
-&lt;a href=&#34;erlang_web/&#34;&gt;Erlang and the Web&lt;/a&gt;
-&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;cowboy - HTTP server&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_introduction&#34;&gt;Introduction&lt;/h2&gt;
+&lt;h2 id=&#34;_description&#34;&gt;Description&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;cowboy&lt;/code&gt; module provides convenience functions for
+manipulating Ranch listeners.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_types&#34;&gt;Types&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_fields_field&#34;&gt;fields() = [Field]&lt;/h3&gt;
+&lt;div class=&#34;listingblock&#34;&gt;
+&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite --&gt;
+&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;color: #009900&#34;&gt;Field&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000080&#34;&gt;atom&lt;/span&gt;&lt;/span&gt;()
+ | {&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000080&#34;&gt;atom&lt;/span&gt;&lt;/span&gt;(), &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy_constraints:constraint&lt;/span&gt;&lt;/span&gt;() | [&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy_constraints:constraint&lt;/span&gt;&lt;/span&gt;()]}
+ | {&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000080&#34;&gt;atom&lt;/span&gt;&lt;/span&gt;(), &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy_constraints:constraint&lt;/span&gt;&lt;/span&gt;() | [&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy_constraints:constraint&lt;/span&gt;&lt;/span&gt;()], &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;any&lt;/span&gt;&lt;/span&gt;()}]&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Fields for match operations. Constraint(s) and default value are optional.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_http_headers_binary_iodata&#34;&gt;http_headers() = [{binary(), iodata()}]&lt;/h3&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;HTTP headers as a list of key/values.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_http_status_non_neg_integer_binary&#34;&gt;http_status() = non_neg_integer() | binary()&lt;/h3&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;HTTP status.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;A binary status can be used to set a custom message.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_http_version_http_1_1_http_1_0&#34;&gt;http_version() = &#39;HTTP/1.1&#39; | &#39;HTTP/1.0&#39;&lt;/h3&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;HTTP version.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_code_onresponse_fun_fun_http_status_http_headers_iodata_cowboy_req_req_gt_cowboy_req_req_code&#34;&gt;&lt;code&gt;onresponse_fun() = fun((http_status(), http_headers(), iodata(), cowboy_req:req()) -&amp;gt; cowboy_req:req())&lt;/code&gt;&lt;/h3&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Fun called immediately before sending the response.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;It can perform any operation on the Req object, including
+reading the request body or replying. If a reply is sent, it
+overrides the reply initially sent. The callback will not be
+called again for the new reply.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_exports&#34;&gt;Exports&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_start_http_ref_nbacceptors_transopts_protoopts_8594_ok_pid&#34;&gt;start_http(Ref, NbAcceptors, TransOpts, ProtoOpts) &amp;#8594; {ok, pid()}&lt;/h3&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Ref = ranch:ref()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;introduction/&#34;&gt;Introduction&lt;/a&gt;
+Listener name.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+NbAcceptors = non_neg_integer()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;getting_started/&#34;&gt;Getting started&lt;/a&gt;
+Number of acceptor processes.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+TransOpts = ranch_tcp:opts()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;flow_diagram/&#34;&gt;Flow diagram&lt;/a&gt;
+TCP transport options.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
-&lt;/div&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+ProtoOpts = cowboy_protocol:opts()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+HTTP protocol options.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Start listening for HTTP connections. Returns the pid for this
+listener&amp;#8217;s supervisor.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_configuration&#34;&gt;Configuration&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_start_https_ref_nbacceptors_transopts_protoopts_8594_ok_pid&#34;&gt;start_https(Ref, NbAcceptors, TransOpts, ProtoOpts) &amp;#8594; {ok, pid()}&lt;/h3&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Ref = ranch:ref()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;listeners/&#34;&gt;Listeners&lt;/a&gt;
+Listener name.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+NbAcceptors = non_neg_integer()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;streams/&#34;&gt;Streams&lt;/a&gt;
+Number of acceptor processes.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+TransOpts = ranch_ssl:opts()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;routing/&#34;&gt;Routing&lt;/a&gt;
+SSL transport options.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+ProtoOpts = cowboy_protocol:opts()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;constraints/&#34;&gt;Constraints&lt;/a&gt;
+HTTP protocol options.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Start listening for HTTPS connections. Returns the pid for this
+listener&amp;#8217;s supervisor.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_stop_listener_ref_8594_ok_error_not_found&#34;&gt;stop_listener(Ref) &amp;#8594; ok | {error, not_found}&lt;/h3&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Ref = ranch:ref()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+Listener name.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Stop a previously started listener.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_handlers&#34;&gt;Handlers&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_set_env_ref_name_value_8594_ok&#34;&gt;set_env(Ref, Name, Value) &amp;#8594; ok&lt;/h3&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Ref = ranch:ref()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;handlers/&#34;&gt;Handlers&lt;/a&gt;
+Listener name.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Name = atom()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;loop_handlers/&#34;&gt;Loop handlers&lt;/a&gt;
+Name of environment value.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Value = any()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;static_files/&#34;&gt;Static files&lt;/a&gt;
+Environment value.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Set or update an environment value for an already running listener.
+This will take effect on all subsequent connections.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_request_and_response&#34;&gt;Request and response&lt;/h2&gt;
+&lt;h2 id=&#34;_see_also&#34;&gt;See also&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;a href=&#34;http://ninenines.eu/docs/en/ranch/HEAD/guide&#34;&gt;Ranch guide&lt;/a&gt;
+provides detailed information about how listeners work.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+</description>
+ </item>
+
+ <item>
+ <title>cowboy(7)</title>
+ <link>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_app/</link>
+ <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
+
+ <guid>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_app/</guid>
+ <description>&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_name&#34;&gt;Name&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;cowboy - Small, fast, modular HTTP server.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_dependencies&#34;&gt;Dependencies&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;cowboy&lt;/code&gt; application uses the Erlang applications &lt;code&gt;ranch&lt;/code&gt;
+for listening and accepting TCP connections, &lt;code&gt;crypto&lt;/code&gt; for
+establishing Websocket connections, and &lt;code&gt;cowlib&lt;/code&gt; for parsing and
+building messages for Web protocols. These dependencies must
+be loaded for the &lt;code&gt;cowboy&lt;/code&gt; application to work. In an embedded
+environment this means that they need to be started with the
+&lt;code&gt;application:start/{1,2}&lt;/code&gt; function before the &lt;code&gt;cowboy&lt;/code&gt;
+application is started.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;cowboy&lt;/code&gt; application also uses the Erlang applications
+&lt;code&gt;asn1&lt;/code&gt;, &lt;code&gt;public_key&lt;/code&gt; and &lt;code&gt;ssl&lt;/code&gt; when listening for HTTPS connections.
+These are started automatically if they weren&amp;#8217;t before.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_environment&#34;&gt;Environment&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;cowboy&lt;/code&gt; application does not define any application
+environment configuration parameters.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+</description>
+ </item>
+
+ <item>
+ <title>cowboy_handler(3)</title>
+ <link>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_handler/</link>
+ <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
+
+ <guid>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_handler/</guid>
+ <description>&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_name&#34;&gt;Name&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;cowboy_handler - handler middleware and behaviour&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_description&#34;&gt;Description&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;cowboy_handler&lt;/code&gt; middleware executes the handler passed
+through the environment values &lt;code&gt;handler&lt;/code&gt; and &lt;code&gt;handler_opts&lt;/code&gt;,
+and adds the result of this execution to the environment as
+the value &lt;code&gt;result&lt;/code&gt;, indicating that the request has been
+handled and received a response.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Environment input:&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+handler = module()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;req/&#34;&gt;Request details&lt;/a&gt;
+Handler to be executed.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+handler_opts = any()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;req_body/&#34;&gt;Reading the request body&lt;/a&gt;
+Options to be passed to the handler.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Environment output:&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+result = ok
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;resp/&#34;&gt;Sending a response&lt;/a&gt;
+Result of the request.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This module also defines the &lt;code&gt;cowboy_handler&lt;/code&gt; behaviour that
+defines the basic interface for handlers. All Cowboy handlers
+implement at least the &lt;code&gt;init/2&lt;/code&gt; callback, and may implement
+the &lt;code&gt;terminate/3&lt;/code&gt; callback optionally.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_terminate_reasons&#34;&gt;Terminate reasons&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The following values may be received as the terminate reason
+in the optional &lt;code&gt;terminate/3&lt;/code&gt; callback. Different handler types
+may define additional terminate reasons.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+normal
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;cookies/&#34;&gt;Using cookies&lt;/a&gt;
+ The connection was closed normally.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+{crash, Class, Reason}
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;multipart/&#34;&gt;Multipart&lt;/a&gt;
+ A crash occurred in the handler. &lt;code&gt;Class&lt;/code&gt; and &lt;code&gt;Reason&lt;/code&gt; can be
+ used to obtain more information about the crash. The function
+ &lt;code&gt;erlang:get_stacktrace/0&lt;/code&gt; can also be called to obtain the
+ stacktrace of the process when the crash occurred.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_rest&#34;&gt;REST&lt;/h2&gt;
+&lt;h2 id=&#34;_callbacks&#34;&gt;Callbacks&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_init_req_opts_8594_ok_req_state_module_req_state_module_req_state_hibernate_timeout_module_req_state_timeout_hibernate&#34;&gt;init(Req, Opts) &amp;#8594; {ok, Req, State} | {Module, Req, State} | {Module, Req, State, hibernate | Timeout} | {Module, Req, State, Timeout, hibernate}&lt;/h3&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Req = cowboy_req:req()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;rest_principles/&#34;&gt;REST principles&lt;/a&gt;
+The Req object.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Opts = any()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;rest_handlers/&#34;&gt;Handling REST requests&lt;/a&gt;
+Handler options.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+State = any()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;rest_flowcharts/&#34;&gt;REST flowcharts&lt;/a&gt;
+Handler state.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Module = module()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;resource_design/&#34;&gt;Designing a resource handler&lt;/a&gt;
+Module of the sub-protocol to use.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_websocket&#34;&gt;Websocket&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Timeout = timeout()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;ws_protocol/&#34;&gt;The Websocket protocol&lt;/a&gt;
+Timeout passed to the sub-protocol, when applicable.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Process the request.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This function can be used to switch to an alternate handler
+type by returning the name of the module to be used, along
+with a few options.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;For basic handlers this is the function where the response
+should be sent. If no response is sent, Cowboy will ensure
+that a &lt;code&gt;204 No Content&lt;/code&gt; response is sent.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;A crash in this callback will result in &lt;code&gt;terminate/3&lt;/code&gt; being
+called if it is defined, with the &lt;code&gt;State&lt;/code&gt; argument set to
+the value of &lt;code&gt;Opts&lt;/code&gt; originally given to the &lt;code&gt;init/2&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_terminate_reason_req_state_8594_ok&#34;&gt;terminate(Reason, Req, State) &amp;#8594; ok&lt;/h3&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Reason = any()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;ws_handlers/&#34;&gt;Handling Websocket connections&lt;/a&gt;
+Reason for termination.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Req = cowboy_req:req()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+The Req object.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+State = any()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+Handler state.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Perform any necessary cleanup of the state.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This callback should release any resource currently in use,
+clear any active timer and reset the process to its original
+state, as it might be reused for future requests sent on the
+same connection. Typical plain HTTP handlers rarely need to
+use it.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;A crash in this callback or an invalid return value will
+result in the closing of the connection and the termination
+of the process.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_internals&#34;&gt;Internals&lt;/h2&gt;
+&lt;h2 id=&#34;_exports&#34;&gt;Exports&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
-&lt;p&gt;
-&lt;a href=&#34;architecture/&#34;&gt;Architecture&lt;/a&gt;
-&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_terminate_reason_req_state_handler_8594_ok&#34;&gt;terminate(Reason, Req, State, Handler) &amp;#8594; ok&lt;/h3&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Reason = any()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;broken_clients/&#34;&gt;Dealing with broken clients&lt;/a&gt;
+Reason for termination.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Req = cowboy_req:req()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;middlewares/&#34;&gt;Middlewares&lt;/a&gt;
+The Req object.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+State = any()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;sub_protocols/&#34;&gt;Sub protocols&lt;/a&gt;
+Handler state.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
-&lt;div class=&#34;ulist&#34;&gt;&lt;ul&gt;
-&lt;li&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Handler = module()
+&lt;/dt&gt;
+&lt;dd&gt;
&lt;p&gt;
-&lt;a href=&#34;hooks/&#34;&gt;Hooks&lt;/a&gt;
+Handler module.
&lt;/p&gt;
-&lt;/li&gt;
-&lt;/ul&gt;&lt;/div&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Call the optional &lt;code&gt;terminate/3&lt;/code&gt; callback if it exists.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This function should always be called at the end of the execution
+of a handler, to give it a chance to clean up or perform
+miscellaneous operations.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
</item>
<item>
- <title>Dealing with broken clients</title>
- <link>http://ninenines.eu/docs/en/cowboy/2.0/guide/broken_clients/</link>
+ <title>cowboy_loop(3)</title>
+ <link>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_loop/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
- <guid>http://ninenines.eu/docs/en/cowboy/2.0/guide/broken_clients/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;There exists a very large number of implementations for the
-HTTP protocol. Most widely used clients, like browsers,
-follow the standard quite well, but others may not. In
-particular custom enterprise clients tend to be very badly
-written.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy tries to follow the standard as much as possible,
-but is not trying to handle every possible special cases.
-Instead Cowboy focuses on the cases reported in the wild,
-on the public Web.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;That means clients that ignore the HTTP standard completely
-may fail to understand Cowboy&amp;#8217;s responses. There are of
-course workarounds. This chapter aims to cover them.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_lowercase_headers&#34;&gt;Lowercase headers&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy converts all headers it receives to lowercase, and
-similarly sends back headers all in lowercase. Some broken
-HTTP clients have issues with that.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;A simple way to solve this is to create an &lt;code&gt;onresponse&lt;/code&gt; hook
-that will format the header names with the expected case.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;capitalize_hook&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #009900&#34;&gt;Status&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Headers&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Body&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Req&lt;/span&gt;) &lt;span style=&#34;color: #990000&#34;&gt;-&amp;gt;&lt;/span&gt;
- &lt;span style=&#34;color: #009900&#34;&gt;Headers2&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; [{&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy_bstr:capitalize_token&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #009900&#34;&gt;N&lt;/span&gt;), &lt;span style=&#34;color: #009900&#34;&gt;V&lt;/span&gt;}
- || {&lt;span style=&#34;color: #009900&#34;&gt;N&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;V&lt;/span&gt;} &lt;span style=&#34;color: #990000&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span style=&#34;color: #009900&#34;&gt;Headers&lt;/span&gt;],
- &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy_req:reply&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #009900&#34;&gt;Status&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Headers2&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Body&lt;/span&gt;, &lt;span style=&#34;color: #009900&#34;&gt;Req&lt;/span&gt;)&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Note that HTTP/2 clients do not have that particular issue
-because the specification explicitly says all headers are
-lowercase, unlike HTTP which allows any case but treats
-them as case insensitive.&lt;/p&gt;&lt;/div&gt;
+ <guid>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_loop/</guid>
+ <description>&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_name&#34;&gt;Name&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;cowboy_loop - loop handlers&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_camel_case_headers&#34;&gt;Camel-case headers&lt;/h2&gt;
+&lt;h2 id=&#34;_description&#34;&gt;Description&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Sometimes it is desirable to keep the actual case used by
-clients, for example when acting as a proxy between two broken
-implementations. There is no easy solution for this other than
-forking the project and editing the &lt;code&gt;cowboy_protocol&lt;/code&gt; file
-directly.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;cowboy_loop&lt;/code&gt; module implements a handler interface for
+long running HTTP connections. It is the recommended interface
+for long polling and server-sent events, amongst others.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This module is a sub protocol that defines three callbacks to
+be implemented by handlers. The &lt;code&gt;init/2&lt;/code&gt; and &lt;code&gt;terminate/3&lt;/code&gt;
+callbacks are common to all handler types and are documented
+in the manual for the &lt;a href=&#34;cowboy_handler.asciidoc&#34;&gt;cowboy_handler&lt;/a&gt; module.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;info/3&lt;/code&gt; callback is specific to loop handlers and will be
+called as many times as necessary until a reply is sent.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;It is highly recommended to return a timeout value from the
+&lt;code&gt;init/2&lt;/code&gt; callback to ensure that the process is terminated
+when no data has been received during that timespan. The
+default timeout is &lt;code&gt;infinity&lt;/code&gt;, which should only be used if
+you have alternate means of ending inactive connections.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_chunked_transfer_encoding&#34;&gt;Chunked transfer-encoding&lt;/h2&gt;
+&lt;h2 id=&#34;_terminate_reasons&#34;&gt;Terminate reasons&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Sometimes an HTTP client advertises itself as HTTP/1.1 but
-does not support chunked transfer-encoding. This is invalid
-behavior, as HTTP/1.1 clients are required to support it.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;A simple workaround exists in these cases. By changing the
-Req object response state to &lt;code&gt;waiting_stream&lt;/code&gt;, Cowboy will
-understand that it must use the identity transfer-encoding
-when replying, just like if it was an HTTP/1.0 client.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;color: #009900&#34;&gt;Req2&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy_req:set&lt;/span&gt;&lt;/span&gt;(&lt;span style=&#34;color: #FF6600&#34;&gt;resp_state&lt;/span&gt;, &lt;span style=&#34;color: #FF6600&#34;&gt;waiting_stream&lt;/span&gt;)&lt;span style=&#34;color: #990000&#34;&gt;.&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The following values may be received as the terminate reason
+in the optional &lt;code&gt;terminate/3&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+normal
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ The connection was closed normally before switching to the
+ loop sub protocol. This typically happens if an &lt;code&gt;ok&lt;/code&gt; tuple is
+ returned from the &lt;code&gt;init/2&lt;/code&gt; callback.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+stop
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ The handler requested to close the connection by returning
+ a &lt;code&gt;stop&lt;/code&gt; tuple.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+timeout
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ The connection has been closed due to inactivity. The timeout
+ value can be configured from &lt;code&gt;init/2&lt;/code&gt;. The response sent when
+ this happens is a &lt;code&gt;204 No Content&lt;/code&gt;.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+{crash, Class, Reason}
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ A crash occurred in the handler. &lt;code&gt;Class&lt;/code&gt; and &lt;code&gt;Reason&lt;/code&gt; can be
+ used to obtain more information about the crash. The function
+ &lt;code&gt;erlang:get_stacktrace/0&lt;/code&gt; can also be called to obtain the
+ stacktrace of the process when the crash occurred.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+{error, overflow}
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ The connection is being closed and the process terminated
+ because the buffer Cowboy uses to keep data sent by the
+ client has reached its maximum. The buffer size can be
+ configured through the environment value &lt;code&gt;loop_max_buffer&lt;/code&gt;
+ and defaults to 5000 bytes.
+ &lt;br /&gt;
+ If the long running request comes with a body it is recommended
+ to process this body before switching to the loop sub protocol.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+{error, closed}
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ The socket has been closed brutally without a close frame being
+ received first.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+{error, Reason}
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ A socket error ocurred.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_callbacks&#34;&gt;Callbacks&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_info_info_req_state_8594_ok_req_state_ok_req_state_hibernate_stop_req_state&#34;&gt;info(Info, Req, State) &amp;#8594; {ok, Req, State} | {ok, Req, State, hibernate} | {stop, Req, State}&lt;/h3&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Info = any()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+Message received by the process.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Req = cowboy_req:req()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+The Req object.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+State = any()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+Handler state.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Handle the Erlang message received.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This function will be called every time an Erlang message
+has been received. The message can be any Erlang term.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;stop&lt;/code&gt; return value can be used to stop the receive loop,
+typically because a response has been sent.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;hibernate&lt;/code&gt; option will hibernate the process until
+it receives another message.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
</item>
<item>
- <title>Designing a resource handler</title>
- <link>http://ninenines.eu/docs/en/cowboy/2.0/guide/resource_design/</link>
+ <title>cowboy_middleware(3)</title>
+ <link>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_middleware/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
- <guid>http://ninenines.eu/docs/en/cowboy/2.0/guide/resource_design/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This chapter aims to provide you with a list of questions
-you must answer in order to write a good resource handler.
-It is meant to be usable as a step by step guide.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_the_service&#34;&gt;The service&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Can the service become unavailable, and when it does, can
-we detect it? For example, database connectivity problems
-may be detected early. We may also have planned outages
-of all or parts of the system. Implement the
-&lt;code&gt;service_available&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;What HTTP methods does the service implement? Do we need
-more than the standard OPTIONS, HEAD, GET, PUT, POST,
-PATCH and DELETE? Are we not using one of those at all?
-Implement the &lt;code&gt;known_methods&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_type_of_resource_handler&#34;&gt;Type of resource handler&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Am I writing a handler for a collection of resources,
-or for a single resource?&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The semantics for each of these are quite different.
-You should not mix collection and single resource in
-the same handler.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_collection_handler&#34;&gt;Collection handler&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Skip this section if you are not doing a collection.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Is the collection hardcoded or dynamic? For example,
-if you use the route &lt;code&gt;/users&lt;/code&gt; for the collection of
-users then the collection is hardcoded; if you use
-&lt;code&gt;/forums/:category&lt;/code&gt; for the collection of threads
-then it isn&amp;#8217;t. When the collection is hardcoded you
-can safely assume the resource always exists.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;What methods should I implement?&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;OPTIONS is used to get some information about the
-collection. It is recommended to allow it even if you
-do not implement it, as Cowboy has a default
-implementation built-in.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;HEAD and GET are used to retrieve the collection.
-If you allow GET, also allow HEAD as there&amp;#8217;s no extra
-work required to make it work.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;POST is used to create a new resource inside the
-collection. Creating a resource by using POST on
-the collection is useful when resources may be
-created before knowing their URI, usually because
-parts of it are generated dynamically. A common
-case is some kind of auto incremented integer
-identifier.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The next methods are more rarely allowed.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;PUT is used to create a new collection (when
-the collection isn&amp;#8217;t hardcoded), or replace
-the entire collection.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;DELETE is used to delete the entire collection.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;PATCH is used to modify the collection using
-instructions given in the request body. A PATCH
-operation is atomic. The PATCH operation may
-be used for such things as reordering; adding,
-modifying or deleting parts of the collection.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_single_resource_handler&#34;&gt;Single resource handler&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Skip this section if you are doing a collection.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;What methods should I implement?&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;OPTIONS is used to get some information about the
-resource. It is recommended to allow it even if you
-do not implement it, as Cowboy has a default
-implementation built-in.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;HEAD and GET are used to retrieve the resource.
-If you allow GET, also allow HEAD as there&amp;#8217;s no extra
-work required to make it work.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;POST is used to update the resource.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;PUT is used to create a new resource (when it doesn&amp;#8217;t
-already exist) or replace the resource.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;DELETE is used to delete the resource.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;PATCH is used to modify the resource using
-instructions given in the request body. A PATCH
-operation is atomic. The PATCH operation may
-be used for adding, removing or modifying specific
-values in the resource.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_the_resource&#34;&gt;The resource&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Following the above discussion, implement the
-&lt;code&gt;allowed_methods&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Does the resource always exist? If it may not, implement
-the &lt;code&gt;resource_exists&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Do I need to authenticate the client before they can
-access the resource? What authentication mechanisms
-should I provide? This may include form-based, token-based
-(in the URL or a cookie), HTTP basic, HTTP digest,
-SSL certificate or any other form of authentication.
-Implement the &lt;code&gt;is_authorized&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Do I need fine-grained access control? How do I determine
-that they are authorized access? Handle that in your
-&lt;code&gt;is_authorized&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Can access to a resource be forbidden regardless of access
-being authorized? A simple example of that is censorship
-of a resource. Implement the &lt;code&gt;forbidden&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Are there any constraints on the length of the resource URI?
-For example, the URI may be used as a key in storage and may
-have a limit in length. Implement &lt;code&gt;uri_too_long&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_representations&#34;&gt;Representations&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;What media types do I provide? If text based, what charsets
-are provided? What languages do I provide?&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Implement the mandatory &lt;code&gt;content_types_provided&lt;/code&gt;. Prefix
-the callbacks with &lt;code&gt;to_&lt;/code&gt; for clarity. For example, &lt;code&gt;to_html&lt;/code&gt;
-or &lt;code&gt;to_text&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Implement the &lt;code&gt;languages_provided&lt;/code&gt; or &lt;code&gt;charsets_provided&lt;/code&gt;
-callbacks if applicable.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Is there any other header that may make the representation
-of the resource vary? Implement the &lt;code&gt;variances&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Depending on your choices for caching content, you may
-want to implement one or more of the &lt;code&gt;generate_etag&lt;/code&gt;,
-&lt;code&gt;last_modified&lt;/code&gt; and &lt;code&gt;expires&lt;/code&gt; callbacks.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Do I want the user or user agent to actively choose a
-representation available? Send a list of available
-representations in the response body and implement
-the &lt;code&gt;multiple_choices&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_redirections&#34;&gt;Redirections&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Do I need to keep track of what resources were deleted?
-For example, you may have a mechanism where moving a
-resource leaves a redirect link to its new location.
-Implement the &lt;code&gt;previously_existed&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Was the resource moved, and is the move temporary? If
-it is explicitly temporary, for example due to maintenance,
-implement the &lt;code&gt;moved_temporarily&lt;/code&gt; callback. Otherwise,
-implement the &lt;code&gt;moved_permanently&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_the_request&#34;&gt;The request&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Do we need to perform extra checks to make sure the request
-is valid? Cowboy will do many checks when receiving the
-request already, do we need more? Note that this only
-applies to the request-line and headers of the request,
-and not the body. Implement &lt;code&gt;malformed_request&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;May there be a request body? Will I know its size?
-What&amp;#8217;s the maximum size of the request body I&amp;#8217;m willing
-to accept? Implement &lt;code&gt;valid_entity_length&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Finally, take a look at the sections corresponding to the
-methods you are implementing.&lt;/p&gt;&lt;/div&gt;
+ <guid>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_middleware/</guid>
+ <description>&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_name&#34;&gt;Name&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;cowboy_middleware - behaviour for middlewares&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_options_method&#34;&gt;OPTIONS method&lt;/h2&gt;
+&lt;h2 id=&#34;_description&#34;&gt;Description&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Cowboy by default will send back a list of allowed methods.
-Do I need to add more information to the response? Implement
-the &lt;code&gt;options&lt;/code&gt; method.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;cowboy_middleware&lt;/code&gt; behaviour defines the interface used
+by Cowboy middleware modules.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Middlewares process the request sequentially in the order they
+are configured.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_get_and_head_methods&#34;&gt;GET and HEAD methods&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you implement the methods GET and/or HEAD, you must
-implement one &lt;code&gt;ProvideResource&lt;/code&gt; callback for each
-content-type returned by the &lt;code&gt;content_types_provided&lt;/code&gt;
-callback.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_put_post_and_patch_methods&#34;&gt;PUT, POST and PATCH methods&lt;/h2&gt;
+&lt;h2 id=&#34;_types&#34;&gt;Types&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you implement the methods PUT, POST and/or PATCH,
-you must implement the &lt;code&gt;content_types_accepted&lt;/code&gt; callback,
-and one &lt;code&gt;AcceptResource&lt;/code&gt; callback for each content-type
-it returns. Prefix the &lt;code&gt;AcceptResource&lt;/code&gt; callback names
-with &lt;code&gt;from_&lt;/code&gt; for clarity. For example, &lt;code&gt;from_html&lt;/code&gt; or
-&lt;code&gt;from_json&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Do we want to allow the POST method to create individual
-resources directly through their URI (like PUT)? Implement
-the &lt;code&gt;allow_missing_post&lt;/code&gt; callback. It is recommended to
-explicitly use PUT in these cases instead.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;May there be conflicts when using PUT to create or replace
-a resource? Do we want to make sure that two updates around
-the same time are not cancelling one another? Implement the
-&lt;code&gt;is_conflict&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_env_atom_any&#34;&gt;env() = [{atom(), any()}]&lt;/h3&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The environment variable.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;One is created for every request. It is passed to each
+middleware module executed and subsequently returned,
+optionally with its contents modified.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_delete_methods&#34;&gt;DELETE methods&lt;/h2&gt;
+&lt;h2 id=&#34;_callbacks&#34;&gt;Callbacks&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;If you implement the method DELETE, you must implement
-the &lt;code&gt;delete_resource&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;When &lt;code&gt;delete_resource&lt;/code&gt; returns, is the resource completely
-removed from the server, including from any caching service?
-If not, and/or if the deletion is asynchronous and we have
-no way of knowing it has been completed yet, implement the
-&lt;code&gt;delete_completed&lt;/code&gt; callback.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_execute_req_env_8594_ok_req_env_suspend_module_function_args_stop_req&#34;&gt;execute(Req, Env) &amp;#8594; {ok, Req, Env} | {suspend, Module, Function, Args} | {stop, Req}&lt;/h3&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Req = cowboy_req:req()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+The Req object.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Env = env()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+The request environment.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Module = module()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+MFA to call when resuming the process.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Function = atom()
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+MFA to call when resuming the process.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+Args = [any()]
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+MFA to call when resuming the process.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Execute the middleware.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;ok&lt;/code&gt; return value indicates that everything went well
+and that Cowboy should continue processing the request. A
+response may or may not have been sent.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;suspend&lt;/code&gt; return value will hibernate the process until
+an Erlang message is received. Note that when resuming, any
+previous stacktrace information will be gone.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;stop&lt;/code&gt; return value stops Cowboy from doing any further
+processing of the request, even if there are middlewares
+that haven&amp;#8217;t been executed yet. The connection may be left
+open to receive more requests from the client.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
</item>
<item>
- <title>Dialyzer</title>
- <link>http://ninenines.eu/docs/en/erlang.mk/1/guide/dialyzer/</link>
+ <title>cowboy_protocol(3)</title>
+ <link>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_protocol/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
- <guid>http://ninenines.eu/docs/en/erlang.mk/1/guide/dialyzer/</guid>
- <description>&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Dialyzer is a tool that will detect discrepancies in your
-program. It does so using a technique known as success
-typing analysis which has the advantage of providing no
-false positives. Dialyzer is able to detect type errors,
-dead code and more.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk provides a wrapper around Dialyzer.&lt;/p&gt;&lt;/div&gt;
+ <guid>http://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy_protocol/</guid>
+ <description>&lt;div class=&#34;sect1&#34;&gt;
+&lt;h2 id=&#34;_name&#34;&gt;Name&lt;/h2&gt;
+&lt;div class=&#34;sectionbody&#34;&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;cowboy_protocol - HTTP protocol&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_how_it_works&#34;&gt;How it works&lt;/h2&gt;
+&lt;h2 id=&#34;_description&#34;&gt;Description&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Dialyzer requires a PLT file to work. The PLT file contains
-the analysis information from all applications which are not
-expected to change, or rarely do. These would be all the
-dependencies of the application or applications you are
-currently working on, including standard applications in
-Erlang/OTP itself.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Dialyzer can generate this PLT file. Erlang.mk includes rules
-to automatically generate the PLT file when it is missing.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Once the PLT file is generated, Dialyzer can perform the
-analysis in record time.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;cowboy_protocol&lt;/code&gt; module implements HTTP/1.1 and HTTP/1.0
+as a Ranch protocol.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_configuration&#34;&gt;Configuration&lt;/h2&gt;
+&lt;h2 id=&#34;_types&#34;&gt;Types&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;In a typical usage scenario, no variable needs to be set.
-The defaults should be enough. Do note however that the
-dependencies need to be set properly using the &lt;code&gt;DEPS&lt;/code&gt; and
-&lt;code&gt;LOCAL_DEPS&lt;/code&gt; variables.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;DIALYZER_PLT&lt;/code&gt; file indicates where the PLT file will
-be written to (and read from). By default this is
-&lt;em&gt;$(PROJECT).plt&lt;/em&gt; in the project&amp;#8217;s directory. Note that
-the &lt;code&gt;DIALYZER_PLT&lt;/code&gt; variable is exported and is understood
-by Dialyzer directly.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The &lt;code&gt;PLT_APPS&lt;/code&gt; variable can be used to add additional
-applications to the PLT. You can either list application
-names or paths to these applications.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Erlang.mk defines two variables for specifying options
-for the analysis: &lt;code&gt;DIALYZER_DIRS&lt;/code&gt; and &lt;code&gt;DIALYZER_OPTS&lt;/code&gt;.
-The former one defines which directories should be part
-of the analysis. The latter defines what extra warnings
-Dialyzer should report.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Note that Erlang.mk enables the race condition warnings
-by default. As it can take considerably large resources
-to run, you may want to disable it on larger projects.&lt;/p&gt;&lt;/div&gt;
-&lt;/div&gt;
-&lt;/div&gt;
-&lt;div class=&#34;sect1&#34;&gt;
-&lt;h2 id=&#34;_usage&#34;&gt;Usage&lt;/h2&gt;
-&lt;div class=&#34;sectionbody&#34;&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;To perform an analysis, run the following command:&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_opts_option&#34;&gt;opts() = [Option]&lt;/h3&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make dialyze&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This will create the PLT file if it doesn&amp;#8217;t exist.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The analysis will also be performed when you run the
-following command, alongside tests:&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;listingblock&#34;&gt;
-&lt;div class=&#34;content&#34;&gt;&lt;!-- Generator: GNU source-highlight 3.1.8
-by Lorenzo Bettini
-http://www.lorenzobettini.it
-http://www.gnu.org/software/src-highlite --&gt;
-&lt;pre&gt;&lt;tt&gt;$ make check&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;You can use the &lt;code&gt;plt&lt;/code&gt; target to create the PLT file if
-it doesn&amp;#8217;t exist. This is normally not necessary as
-Dialyzer creates it automatically.&lt;/p&gt;&lt;/div&gt;
-&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The PLT file will be removed when you run &lt;code&gt;make distclean&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;pre&gt;&lt;tt&gt;&lt;span style=&#34;color: #009900&#34;&gt;Option&lt;/span&gt; &lt;span style=&#34;color: #990000&#34;&gt;=&lt;/span&gt; {&lt;span style=&#34;color: #FF6600&#34;&gt;compress&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;boolean&lt;/span&gt;&lt;/span&gt;()}
+ | {&lt;span style=&#34;color: #FF6600&#34;&gt;env&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy_middleware:env&lt;/span&gt;&lt;/span&gt;()}
+ | {&lt;span style=&#34;color: #FF6600&#34;&gt;max_empty_lines&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;non_neg_integer&lt;/span&gt;&lt;/span&gt;()}
+ | {&lt;span style=&#34;color: #FF6600&#34;&gt;max_header_name_length&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;non_neg_integer&lt;/span&gt;&lt;/span&gt;()}
+ | {&lt;span style=&#34;color: #FF6600&#34;&gt;max_header_value_length&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;non_neg_integer&lt;/span&gt;&lt;/span&gt;()}
+ | {&lt;span style=&#34;color: #FF6600&#34;&gt;max_headers&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;non_neg_integer&lt;/span&gt;&lt;/span&gt;()}
+ | {&lt;span style=&#34;color: #FF6600&#34;&gt;max_keepalive&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;non_neg_integer&lt;/span&gt;&lt;/span&gt;()}
+ | {&lt;span style=&#34;color: #FF6600&#34;&gt;max_request_line_length&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;non_neg_integer&lt;/span&gt;&lt;/span&gt;()}
+ | {&lt;span style=&#34;color: #FF6600&#34;&gt;middlewares&lt;/span&gt;, [&lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;module&lt;/span&gt;&lt;/span&gt;()]}
+ | {&lt;span style=&#34;color: #FF6600&#34;&gt;onresponse&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;cowboy:onresponse_fun&lt;/span&gt;&lt;/span&gt;()}
+ | {&lt;span style=&#34;color: #FF6600&#34;&gt;timeout&lt;/span&gt;, &lt;span style=&#34;font-weight: bold&#34;&gt;&lt;span style=&#34;color: #000000&#34;&gt;timeout&lt;/span&gt;&lt;/span&gt;()}&lt;/tt&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;Configuration for the HTTP protocol handler.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;This configuration is passed to Cowboy when starting listeners
+using &lt;code&gt;cowboy:start_http/4&lt;/code&gt; or &lt;code&gt;cowboy:start_https/4&lt;/code&gt; functions.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;It can be updated without restarting listeners using the
+Ranch functions &lt;code&gt;ranch:get_protocol_options/1&lt;/code&gt; and
+&lt;code&gt;ranch:set_protocol_options/2&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div class=&#34;sect2&#34;&gt;
+&lt;h3 id=&#34;_option_descriptions&#34;&gt;Option descriptions&lt;/h3&gt;
+&lt;div class=&#34;paragraph&#34;&gt;&lt;p&gt;The default value is given next to the option name.&lt;/p&gt;&lt;/div&gt;
+&lt;div class=&#34;dlist&#34;&gt;&lt;dl&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+compress (false)
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ When enabled, Cowboy will attempt to compress the response body.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+env ([{listener, Ref}])
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ Initial middleware environment.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+max_empty_lines (5)
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ Maximum number of empty lines before a request.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+max_header_name_length (64)
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ Maximum length of header names.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+max_header_value_length (4096)
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ Maximum length of header values.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+max_headers (100)
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ Maximum number of headers allowed per request.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+max_keepalive (100)
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ Maximum number of requests allowed per connection.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+max_request_line_length (4096)
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ Maximum length of the request line.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+middlewares ([cowboy_router, cowboy_handler])
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ List of middlewares to execute for every requests.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+onresponse (undefined)
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ Fun called every time a response is sent.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;dt class=&#34;hdlist1&#34;&gt;
+timeout (5000)
+&lt;/dt&gt;
+&lt;dd&gt;
+&lt;p&gt;
+ Time in ms with no requests before Cowboy closes the connection.
+&lt;/p&gt;
+&lt;/dd&gt;
+&lt;/dl&gt;&lt;/div&gt;
+&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>