summaryrefslogtreecommitdiffstats
path: root/docs/en/cowboy/2.0/manual
diff options
context:
space:
mode:
Diffstat (limited to 'docs/en/cowboy/2.0/manual')
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy/index.html328
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_app/index.html171
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_handler/index.html365
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_loop/index.html289
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_middleware/index.html230
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_protocol/index.html279
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_req/index.html1423
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_rest/index.html508
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_router/index.html247
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_static/index.html188
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_sub_protocol/index.html224
-rw-r--r--docs/en/cowboy/2.0/manual/cowboy_websocket/index.html352
-rw-r--r--docs/en/cowboy/2.0/manual/http_status_codes/index.html407
-rw-r--r--docs/en/cowboy/2.0/manual/index.html209
14 files changed, 5220 insertions, 0 deletions
diff --git a/docs/en/cowboy/2.0/manual/cowboy/index.html b/docs/en/cowboy/2.0/manual/cowboy/index.html
new file mode 100644
index 00000000..7c866e32
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy/index.html
@@ -0,0 +1,328 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy - HTTP server</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy</code> module provides convenience functions for
+manipulating Ranch listeners.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_types">Types</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_fields_field">fields() = [Field]</h3>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="color: #009900">Field</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000080">atom</span></span>()
+ | {<span style="font-weight: bold"><span style="color: #000080">atom</span></span>(), <span style="font-weight: bold"><span style="color: #000000">cowboy_constraints:constraint</span></span>() | [<span style="font-weight: bold"><span style="color: #000000">cowboy_constraints:constraint</span></span>()]}
+ | {<span style="font-weight: bold"><span style="color: #000080">atom</span></span>(), <span style="font-weight: bold"><span style="color: #000000">cowboy_constraints:constraint</span></span>() | [<span style="font-weight: bold"><span style="color: #000000">cowboy_constraints:constraint</span></span>()], <span style="font-weight: bold"><span style="color: #000000">any</span></span>()}]</tt></pre></div></div>
+<div class="paragraph"><p>Fields for match operations. Constraint(s) and default value are optional.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_http_headers_binary_iodata">http_headers() = [{binary(), iodata()}]</h3>
+<div class="paragraph"><p>HTTP headers as a list of key/values.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_http_status_non_neg_integer_binary">http_status() = non_neg_integer() | binary()</h3>
+<div class="paragraph"><p>HTTP status.</p></div>
+<div class="paragraph"><p>A binary status can be used to set a custom message.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_http_version_http_1_1_http_1_0">http_version() = 'HTTP/1.1' | 'HTTP/1.0'</h3>
+<div class="paragraph"><p>HTTP version.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_code_onresponse_fun_fun_http_status_http_headers_iodata_cowboy_req_req_gt_cowboy_req_req_code"><code>onresponse_fun() = fun((http_status(), http_headers(), iodata(), cowboy_req:req()) -&gt; cowboy_req:req())</code></h3>
+<div class="paragraph"><p>Fun called immediately before sending the response.</p></div>
+<div class="paragraph"><p>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.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_exports">Exports</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_start_http_ref_nbacceptors_transopts_protoopts_8594_ok_pid">start_http(Ref, NbAcceptors, TransOpts, ProtoOpts) &#8594; {ok, pid()}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Ref = ranch:ref()
+</dt>
+<dd>
+<p>
+Listener name.
+</p>
+</dd>
+<dt class="hdlist1">
+NbAcceptors = non_neg_integer()
+</dt>
+<dd>
+<p>
+Number of acceptor processes.
+</p>
+</dd>
+<dt class="hdlist1">
+TransOpts = ranch_tcp:opts()
+</dt>
+<dd>
+<p>
+TCP transport options.
+</p>
+</dd>
+<dt class="hdlist1">
+ProtoOpts = cowboy_protocol:opts()
+</dt>
+<dd>
+<p>
+HTTP protocol options.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Start listening for HTTP connections. Returns the pid for this
+listener&#8217;s supervisor.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_start_https_ref_nbacceptors_transopts_protoopts_8594_ok_pid">start_https(Ref, NbAcceptors, TransOpts, ProtoOpts) &#8594; {ok, pid()}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Ref = ranch:ref()
+</dt>
+<dd>
+<p>
+Listener name.
+</p>
+</dd>
+<dt class="hdlist1">
+NbAcceptors = non_neg_integer()
+</dt>
+<dd>
+<p>
+Number of acceptor processes.
+</p>
+</dd>
+<dt class="hdlist1">
+TransOpts = ranch_ssl:opts()
+</dt>
+<dd>
+<p>
+SSL transport options.
+</p>
+</dd>
+<dt class="hdlist1">
+ProtoOpts = cowboy_protocol:opts()
+</dt>
+<dd>
+<p>
+HTTP protocol options.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Start listening for HTTPS connections. Returns the pid for this
+listener&#8217;s supervisor.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_stop_listener_ref_8594_ok_error_not_found">stop_listener(Ref) &#8594; ok | {error, not_found}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Ref = ranch:ref()
+</dt>
+<dd>
+<p>
+Listener name.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Stop a previously started listener.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_set_env_ref_name_value_8594_ok">set_env(Ref, Name, Value) &#8594; ok</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Ref = ranch:ref()
+</dt>
+<dd>
+<p>
+Listener name.
+</p>
+</dd>
+<dt class="hdlist1">
+Name = atom()
+</dt>
+<dd>
+<p>
+Name of environment value.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = any()
+</dt>
+<dd>
+<p>
+Environment value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Set or update an environment value for an already running listener.
+This will take effect on all subsequent connections.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_see_also">See also</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <a href="http://ninenines.eu/docs/en/ranch/HEAD/guide">Ranch guide</a>
+provides detailed information about how listeners work.</p></div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_app/index.html b/docs/en/cowboy/2.0/manual/cowboy_app/index.html
new file mode 100644
index 00000000..eaba7602
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_app/index.html
@@ -0,0 +1,171 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy(7)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy(7)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy - Small, fast, modular HTTP server.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_dependencies">Dependencies</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy</code> application uses the Erlang applications <code>ranch</code>
+for listening and accepting TCP connections, <code>crypto</code> for
+establishing Websocket connections, and <code>cowlib</code> for parsing and
+building messages for Web protocols. These dependencies must
+be loaded for the <code>cowboy</code> application to work. In an embedded
+environment this means that they need to be started with the
+<code>application:start/{1,2}</code> function before the <code>cowboy</code>
+application is started.</p></div>
+<div class="paragraph"><p>The <code>cowboy</code> application also uses the Erlang applications
+<code>asn1</code>, <code>public_key</code> and <code>ssl</code> when listening for HTTPS connections.
+These are started automatically if they weren&#8217;t before.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_environment">Environment</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy</code> application does not define any application
+environment configuration parameters.</p></div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_handler/index.html b/docs/en/cowboy/2.0/manual/cowboy_handler/index.html
new file mode 100644
index 00000000..5954d21f
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_handler/index.html
@@ -0,0 +1,365 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy_handler(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy_handler(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_handler - handler middleware and behaviour</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy_handler</code> middleware executes the handler passed
+through the environment values <code>handler</code> and <code>handler_opts</code>,
+and adds the result of this execution to the environment as
+the value <code>result</code>, indicating that the request has been
+handled and received a response.</p></div>
+<div class="paragraph"><p>Environment input:</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+handler = module()
+</dt>
+<dd>
+<p>
+Handler to be executed.
+</p>
+</dd>
+<dt class="hdlist1">
+handler_opts = any()
+</dt>
+<dd>
+<p>
+Options to be passed to the handler.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Environment output:</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+result = ok
+</dt>
+<dd>
+<p>
+Result of the request.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>This module also defines the <code>cowboy_handler</code> behaviour that
+defines the basic interface for handlers. All Cowboy handlers
+implement at least the <code>init/2</code> callback, and may implement
+the <code>terminate/3</code> callback optionally.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_terminate_reasons">Terminate reasons</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The following values may be received as the terminate reason
+in the optional <code>terminate/3</code> callback. Different handler types
+may define additional terminate reasons.</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+normal
+</dt>
+<dd>
+<p>
+ The connection was closed normally.
+</p>
+</dd>
+<dt class="hdlist1">
+{crash, Class, Reason}
+</dt>
+<dd>
+<p>
+ A crash occurred in the handler. <code>Class</code> and <code>Reason</code> can be
+ used to obtain more information about the crash. The function
+ <code>erlang:get_stacktrace/0</code> can also be called to obtain the
+ stacktrace of the process when the crash occurred.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_callbacks">Callbacks</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_init_req_opts_8594_ok_req_state_module_req_state_module_req_state_hibernate_timeout_module_req_state_timeout_hibernate">init(Req, Opts) &#8594; {ok, Req, State} | {Module, Req, State} | {Module, Req, State, hibernate | Timeout} | {Module, Req, State, Timeout, hibernate}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Req = cowboy_req:req()
+</dt>
+<dd>
+<p>
+The Req object.
+</p>
+</dd>
+<dt class="hdlist1">
+Opts = any()
+</dt>
+<dd>
+<p>
+Handler options.
+</p>
+</dd>
+<dt class="hdlist1">
+State = any()
+</dt>
+<dd>
+<p>
+Handler state.
+</p>
+</dd>
+<dt class="hdlist1">
+Module = module()
+</dt>
+<dd>
+<p>
+Module of the sub-protocol to use.
+</p>
+</dd>
+<dt class="hdlist1">
+Timeout = timeout()
+</dt>
+<dd>
+<p>
+Timeout passed to the sub-protocol, when applicable.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Process the request.</p></div>
+<div class="paragraph"><p>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.</p></div>
+<div class="paragraph"><p>For basic handlers this is the function where the response
+should be sent. If no response is sent, Cowboy will ensure
+that a <code>204 No Content</code> response is sent.</p></div>
+<div class="paragraph"><p>A crash in this callback will result in <code>terminate/3</code> being
+called if it is defined, with the <code>State</code> argument set to
+the value of <code>Opts</code> originally given to the <code>init/2</code> callback.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_terminate_reason_req_state_8594_ok">terminate(Reason, Req, State) &#8594; ok</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Reason = any()
+</dt>
+<dd>
+<p>
+Reason for termination.
+</p>
+</dd>
+<dt class="hdlist1">
+Req = cowboy_req:req()
+</dt>
+<dd>
+<p>
+The Req object.
+</p>
+</dd>
+<dt class="hdlist1">
+State = any()
+</dt>
+<dd>
+<p>
+Handler state.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Perform any necessary cleanup of the state.</p></div>
+<div class="paragraph"><p>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.</p></div>
+<div class="paragraph"><p>A crash in this callback or an invalid return value will
+result in the closing of the connection and the termination
+of the process.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_exports">Exports</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_terminate_reason_req_state_handler_8594_ok">terminate(Reason, Req, State, Handler) &#8594; ok</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Reason = any()
+</dt>
+<dd>
+<p>
+Reason for termination.
+</p>
+</dd>
+<dt class="hdlist1">
+Req = cowboy_req:req()
+</dt>
+<dd>
+<p>
+The Req object.
+</p>
+</dd>
+<dt class="hdlist1">
+State = any()
+</dt>
+<dd>
+<p>
+Handler state.
+</p>
+</dd>
+<dt class="hdlist1">
+Handler = module()
+</dt>
+<dd>
+<p>
+Handler module.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Call the optional <code>terminate/3</code> callback if it exists.</p></div>
+<div class="paragraph"><p>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.</p></div>
+</div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_loop/index.html b/docs/en/cowboy/2.0/manual/cowboy_loop/index.html
new file mode 100644
index 00000000..968131fa
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_loop/index.html
@@ -0,0 +1,289 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy_loop(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy_loop(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_loop - loop handlers</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy_loop</code> module implements a handler interface for
+long running HTTP connections. It is the recommended interface
+for long polling and server-sent events, amongst others.</p></div>
+<div class="paragraph"><p>This module is a sub protocol that defines three callbacks to
+be implemented by handlers. The <code>init/2</code> and <code>terminate/3</code>
+callbacks are common to all handler types and are documented
+in the manual for the <a href="cowboy_handler.asciidoc">cowboy_handler</a> module.</p></div>
+<div class="paragraph"><p>The <code>info/3</code> callback is specific to loop handlers and will be
+called as many times as necessary until a reply is sent.</p></div>
+<div class="paragraph"><p>It is highly recommended to return a timeout value from the
+<code>init/2</code> callback to ensure that the process is terminated
+when no data has been received during that timespan. The
+default timeout is <code>infinity</code>, which should only be used if
+you have alternate means of ending inactive connections.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_terminate_reasons">Terminate reasons</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The following values may be received as the terminate reason
+in the optional <code>terminate/3</code> callback.</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+normal
+</dt>
+<dd>
+<p>
+ The connection was closed normally before switching to the
+ loop sub protocol. This typically happens if an <code>ok</code> tuple is
+ returned from the <code>init/2</code> callback.
+</p>
+</dd>
+<dt class="hdlist1">
+stop
+</dt>
+<dd>
+<p>
+ The handler requested to close the connection by returning
+ a <code>stop</code> tuple.
+</p>
+</dd>
+<dt class="hdlist1">
+timeout
+</dt>
+<dd>
+<p>
+ The connection has been closed due to inactivity. The timeout
+ value can be configured from <code>init/2</code>. The response sent when
+ this happens is a <code>204 No Content</code>.
+</p>
+</dd>
+<dt class="hdlist1">
+{crash, Class, Reason}
+</dt>
+<dd>
+<p>
+ A crash occurred in the handler. <code>Class</code> and <code>Reason</code> can be
+ used to obtain more information about the crash. The function
+ <code>erlang:get_stacktrace/0</code> can also be called to obtain the
+ stacktrace of the process when the crash occurred.
+</p>
+</dd>
+<dt class="hdlist1">
+{error, overflow}
+</dt>
+<dd>
+<p>
+ 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 <code>loop_max_buffer</code>
+ and defaults to 5000 bytes.
+ <br />
+ If the long running request comes with a body it is recommended
+ to process this body before switching to the loop sub protocol.
+</p>
+</dd>
+<dt class="hdlist1">
+{error, closed}
+</dt>
+<dd>
+<p>
+ The socket has been closed brutally without a close frame being
+ received first.
+</p>
+</dd>
+<dt class="hdlist1">
+{error, Reason}
+</dt>
+<dd>
+<p>
+ A socket error ocurred.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_callbacks">Callbacks</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_info_info_req_state_8594_ok_req_state_ok_req_state_hibernate_stop_req_state">info(Info, Req, State) &#8594; {ok, Req, State} | {ok, Req, State, hibernate} | {stop, Req, State}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Info = any()
+</dt>
+<dd>
+<p>
+Message received by the process.
+</p>
+</dd>
+<dt class="hdlist1">
+Req = cowboy_req:req()
+</dt>
+<dd>
+<p>
+The Req object.
+</p>
+</dd>
+<dt class="hdlist1">
+State = any()
+</dt>
+<dd>
+<p>
+Handler state.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Handle the Erlang message received.</p></div>
+<div class="paragraph"><p>This function will be called every time an Erlang message
+has been received. The message can be any Erlang term.</p></div>
+<div class="paragraph"><p>The <code>stop</code> return value can be used to stop the receive loop,
+typically because a response has been sent.</p></div>
+<div class="paragraph"><p>The <code>hibernate</code> option will hibernate the process until
+it receives another message.</p></div>
+</div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_middleware/index.html b/docs/en/cowboy/2.0/manual/cowboy_middleware/index.html
new file mode 100644
index 00000000..64fce84c
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_middleware/index.html
@@ -0,0 +1,230 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy_middleware(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy_middleware(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_middleware - behaviour for middlewares</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy_middleware</code> behaviour defines the interface used
+by Cowboy middleware modules.</p></div>
+<div class="paragraph"><p>Middlewares process the request sequentially in the order they
+are configured.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_types">Types</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_env_atom_any">env() = [{atom(), any()}]</h3>
+<div class="paragraph"><p>The environment variable.</p></div>
+<div class="paragraph"><p>One is created for every request. It is passed to each
+middleware module executed and subsequently returned,
+optionally with its contents modified.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_callbacks">Callbacks</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_execute_req_env_8594_ok_req_env_suspend_module_function_args_stop_req">execute(Req, Env) &#8594; {ok, Req, Env} | {suspend, Module, Function, Args} | {stop, Req}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Req = cowboy_req:req()
+</dt>
+<dd>
+<p>
+The Req object.
+</p>
+</dd>
+<dt class="hdlist1">
+Env = env()
+</dt>
+<dd>
+<p>
+The request environment.
+</p>
+</dd>
+<dt class="hdlist1">
+Module = module()
+</dt>
+<dd>
+<p>
+MFA to call when resuming the process.
+</p>
+</dd>
+<dt class="hdlist1">
+Function = atom()
+</dt>
+<dd>
+<p>
+MFA to call when resuming the process.
+</p>
+</dd>
+<dt class="hdlist1">
+Args = [any()]
+</dt>
+<dd>
+<p>
+MFA to call when resuming the process.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Execute the middleware.</p></div>
+<div class="paragraph"><p>The <code>ok</code> return value indicates that everything went well
+and that Cowboy should continue processing the request. A
+response may or may not have been sent.</p></div>
+<div class="paragraph"><p>The <code>suspend</code> return value will hibernate the process until
+an Erlang message is received. Note that when resuming, any
+previous stacktrace information will be gone.</p></div>
+<div class="paragraph"><p>The <code>stop</code> return value stops Cowboy from doing any further
+processing of the request, even if there are middlewares
+that haven&#8217;t been executed yet. The connection may be left
+open to receive more requests from the client.</p></div>
+</div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_protocol/index.html b/docs/en/cowboy/2.0/manual/cowboy_protocol/index.html
new file mode 100644
index 00000000..4fdda0b9
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_protocol/index.html
@@ -0,0 +1,279 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy_protocol(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy_protocol(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_protocol - HTTP protocol</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy_protocol</code> module implements HTTP/1.1 and HTTP/1.0
+as a Ranch protocol.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_types">Types</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_opts_option">opts() = [Option]</h3>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="color: #009900">Option</span> <span style="color: #990000">=</span> {<span style="color: #FF6600">compress</span>, <span style="font-weight: bold"><span style="color: #000000">boolean</span></span>()}
+ | {<span style="color: #FF6600">env</span>, <span style="font-weight: bold"><span style="color: #000000">cowboy_middleware:env</span></span>()}
+ | {<span style="color: #FF6600">max_empty_lines</span>, <span style="font-weight: bold"><span style="color: #000000">non_neg_integer</span></span>()}
+ | {<span style="color: #FF6600">max_header_name_length</span>, <span style="font-weight: bold"><span style="color: #000000">non_neg_integer</span></span>()}
+ | {<span style="color: #FF6600">max_header_value_length</span>, <span style="font-weight: bold"><span style="color: #000000">non_neg_integer</span></span>()}
+ | {<span style="color: #FF6600">max_headers</span>, <span style="font-weight: bold"><span style="color: #000000">non_neg_integer</span></span>()}
+ | {<span style="color: #FF6600">max_keepalive</span>, <span style="font-weight: bold"><span style="color: #000000">non_neg_integer</span></span>()}
+ | {<span style="color: #FF6600">max_request_line_length</span>, <span style="font-weight: bold"><span style="color: #000000">non_neg_integer</span></span>()}
+ | {<span style="color: #FF6600">middlewares</span>, [<span style="font-weight: bold"><span style="color: #000000">module</span></span>()]}
+ | {<span style="color: #FF6600">onresponse</span>, <span style="font-weight: bold"><span style="color: #000000">cowboy:onresponse_fun</span></span>()}
+ | {<span style="color: #FF6600">timeout</span>, <span style="font-weight: bold"><span style="color: #000000">timeout</span></span>()}</tt></pre></div></div>
+<div class="paragraph"><p>Configuration for the HTTP protocol handler.</p></div>
+<div class="paragraph"><p>This configuration is passed to Cowboy when starting listeners
+using <code>cowboy:start_http/4</code> or <code>cowboy:start_https/4</code> functions.</p></div>
+<div class="paragraph"><p>It can be updated without restarting listeners using the
+Ranch functions <code>ranch:get_protocol_options/1</code> and
+<code>ranch:set_protocol_options/2</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_option_descriptions">Option descriptions</h3>
+<div class="paragraph"><p>The default value is given next to the option name.</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+compress (false)
+</dt>
+<dd>
+<p>
+ When enabled, Cowboy will attempt to compress the response body.
+</p>
+</dd>
+<dt class="hdlist1">
+env ([{listener, Ref}])
+</dt>
+<dd>
+<p>
+ Initial middleware environment.
+</p>
+</dd>
+<dt class="hdlist1">
+max_empty_lines (5)
+</dt>
+<dd>
+<p>
+ Maximum number of empty lines before a request.
+</p>
+</dd>
+<dt class="hdlist1">
+max_header_name_length (64)
+</dt>
+<dd>
+<p>
+ Maximum length of header names.
+</p>
+</dd>
+<dt class="hdlist1">
+max_header_value_length (4096)
+</dt>
+<dd>
+<p>
+ Maximum length of header values.
+</p>
+</dd>
+<dt class="hdlist1">
+max_headers (100)
+</dt>
+<dd>
+<p>
+ Maximum number of headers allowed per request.
+</p>
+</dd>
+<dt class="hdlist1">
+max_keepalive (100)
+</dt>
+<dd>
+<p>
+ Maximum number of requests allowed per connection.
+</p>
+</dd>
+<dt class="hdlist1">
+max_request_line_length (4096)
+</dt>
+<dd>
+<p>
+ Maximum length of the request line.
+</p>
+</dd>
+<dt class="hdlist1">
+middlewares ([cowboy_router, cowboy_handler])
+</dt>
+<dd>
+<p>
+ List of middlewares to execute for every requests.
+</p>
+</dd>
+<dt class="hdlist1">
+onresponse (undefined)
+</dt>
+<dd>
+<p>
+ Fun called every time a response is sent.
+</p>
+</dd>
+<dt class="hdlist1">
+timeout (5000)
+</dt>
+<dd>
+<p>
+ Time in ms with no requests before Cowboy closes the connection.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_req/index.html b/docs/en/cowboy/2.0/manual/cowboy_req/index.html
new file mode 100644
index 00000000..99c4915f
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_req/index.html
@@ -0,0 +1,1423 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy_req(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy_req(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_req - HTTP request and response</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy_req</code> module provides functions to access, manipulate
+and respond to requests.</p></div>
+<div class="paragraph"><p>The functions in this module follow patterns for their return types,
+based on the kind of function.</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+access: <code>Value</code>
+</p>
+</li>
+<li>
+<p>
+action: <code>ok | {Result, Req} | {Result, Value, Req}</code>
+</p>
+</li>
+<li>
+<p>
+modification: <code>Req</code>
+</p>
+</li>
+<li>
+<p>
+question: <code>boolean()</code>
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>Whenever <code>Req</code> is returned, you must use this returned value and
+ignore any previous you may have had. This value contains various
+values which are necessary for Cowboy to keep track of the request
+and response states.</p></div>
+<div class="paragraph"><p>All functions which perform an action should only be called once.
+This includes reading the request body or replying. Cowboy will
+throw an error on the second call when it detects suspicious behavior.</p></div>
+<div class="paragraph"><p>It is highly discouraged to pass the Req object to another process.
+Doing so and calling <code>cowboy_req</code> functions from it leads to
+undefined behavior.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_types">Types</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_body_opts_option">body_opts() = [Option]</h3>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="color: #009900">Option</span> <span style="color: #990000">=</span> {<span style="color: #FF6600">continue</span>, <span style="font-weight: bold"><span style="color: #000000">boolean</span></span>()}
+ | {<span style="font-weight: bold"><span style="color: #000080">length</span></span>, <span style="font-weight: bold"><span style="color: #000000">non_neg_integer</span></span>()}
+ | {<span style="color: #FF6600">read_length</span>, <span style="font-weight: bold"><span style="color: #000000">non_neg_integer</span></span>()}
+ | {<span style="color: #FF6600">read_timeout</span>, <span style="font-weight: bold"><span style="color: #000000">timeout</span></span>()}
+ | {<span style="color: #FF6600">transfer_decode</span>, <span style="font-weight: bold"><span style="color: #000000">transfer_decode_fun</span></span>(), <span style="font-weight: bold"><span style="color: #000000">any</span></span>()}
+ | {<span style="color: #FF6600">content_decode</span>, <span style="font-weight: bold"><span style="color: #000000">content_decode_fun</span></span>()}</tt></pre></div></div>
+<div class="paragraph"><p>Request body reading options.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_cookie_opts_option">cookie_opts() = [Option]</h3>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="color: #009900">Option</span> <span style="color: #990000">=</span> {<span style="color: #FF6600">max_age</span>, <span style="font-weight: bold"><span style="color: #000000">non_neg_integer</span></span>()}
+ | {<span style="color: #FF6600">domain</span>, <span style="font-weight: bold"><span style="color: #000080">binary</span></span>()}
+ | {<span style="color: #FF6600">path</span>, <span style="font-weight: bold"><span style="color: #000080">binary</span></span>()}
+ | {<span style="color: #FF6600">secure</span>, <span style="font-weight: bold"><span style="color: #000000">boolean</span></span>()}
+ | {<span style="color: #FF6600">http_only</span>, <span style="font-weight: bold"><span style="color: #000000">boolean</span></span>()}</tt></pre></div></div>
+<div class="paragraph"><p>Cookie options.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_req_opaque_to_the_user">req() - opaque to the user</h3>
+<div class="paragraph"><p>The Req object.</p></div>
+<div class="paragraph"><p>All functions in this module receive a <code>Req</code> as argument,
+and some of them return a new object labelled <code>Req2</code> in
+the function descriptions below.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_request_related_exports">Request related exports</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_binding_name_req_8594_binding_name_req_undefined">binding(Name, Req) &#8594; binding(Name, Req, undefined)</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:binding/3</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_binding_name_req_default_8594_value">binding(Name, Req, Default) &#8594; Value</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = atom()
+</dt>
+<dd>
+<p>
+Binding name.
+</p>
+</dd>
+<dt class="hdlist1">
+Default = any()
+</dt>
+<dd>
+<p>
+Default value.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = any() | Default
+</dt>
+<dd>
+<p>
+Binding value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the value for the given binding.</p></div>
+<div class="paragraph"><p>By default the value is a binary, however constraints may change
+the type of this value (for example automatically converting
+numbers to integer).</p></div>
+</div>
+<div class="sect2">
+<h3 id="_bindings_req_8594_name_value">bindings(Req) &#8594; [{Name, Value}]</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = atom()
+</dt>
+<dd>
+<p>
+Binding name.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = any()
+</dt>
+<dd>
+<p>
+Binding value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return all bindings.</p></div>
+<div class="paragraph"><p>By default the value is a binary, however constraints may change
+the type of this value (for example automatically converting
+numbers to integer).</p></div>
+</div>
+<div class="sect2">
+<h3 id="_header_name_req_8594_header_name_req_undefined">header(Name, Req) &#8594; header(Name, Req, undefined)</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:header/3</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_header_name_req_default_8594_value">header(Name, Req, Default) &#8594; Value</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = binary()
+</dt>
+<dd>
+<p>
+Request header name.
+</p>
+</dd>
+<dt class="hdlist1">
+Default = any()
+</dt>
+<dd>
+<p>
+Default value.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = binary() | Default
+</dt>
+<dd>
+<p>
+Request header value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the value for the given header.</p></div>
+<div class="paragraph"><p>While header names are case insensitive, this function expects
+the name to be a lowercase binary.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_headers_req_8594_headers">headers(Req) &#8594; Headers</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Headers = cowboy:http_headers()
+</dt>
+<dd>
+<p>
+Request headers.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return all headers.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_host_req_8594_host">host(Req) &#8594; Host</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Host = binary()
+</dt>
+<dd>
+<p>
+Requested host.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the requested host.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_host_info_req_8594_hostinfo">host_info(Req) &#8594; HostInfo</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+HostInfo = cowboy_router:tokens() | undefined
+</dt>
+<dd>
+<p>
+Extra tokens for the host.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the extra tokens from matching against <code>...</code> during routing.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_host_url_req_8594_hosturl">host_url(Req) &#8594; HostURL</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+HostURL = binary() | undefined
+</dt>
+<dd>
+<p>
+Requested URL, without the path component.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the requested URL excluding the path component.</p></div>
+<div class="paragraph"><p>This function will always return <code>undefined</code> until the
+<code>cowboy_router</code> middleware has been executed.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_match_cookies_fields_req_8594_map">match_cookies(Fields, Req) &#8594; Map</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Fields = cowboy:fields()
+</dt>
+<dd>
+<p>
+Cookie fields match rules.
+</p>
+</dd>
+<dt class="hdlist1">
+Map = map()
+</dt>
+<dd>
+<p>
+Cookie fields matched.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Match cookies against the given fields.</p></div>
+<div class="paragraph"><p>Cowboy will only return the cookie values specified in the
+fields list, and ignore all others. Fields can be either
+the name of the cookie requested; the name along with a
+list of constraints; or the name, a list of constraints
+and a default value in case the cookie is missing.</p></div>
+<div class="paragraph"><p>This function will crash if the cookie is missing and no
+default value is provided. This function will also crash
+if a constraint fails.</p></div>
+<div class="paragraph"><p>The name of the cookie must be provided as an atom. The
+key of the returned map will be that atom. The value may
+be converted through the use of constraints, making this
+function able to extract, validate and convert values all
+in one step.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_match_qs_fields_req_8594_map">match_qs(Fields, Req) &#8594; Map</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Fields = cowboy:fields()
+</dt>
+<dd>
+<p>
+Query string fields match rules.
+</p>
+</dd>
+<dt class="hdlist1">
+Map = map()
+</dt>
+<dd>
+<p>
+Query string fields matched.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Match the query string against the given fields.</p></div>
+<div class="paragraph"><p>Cowboy will only return the query string values specified
+in the fields list, and ignore all others. Fields can be
+either the key requested; the key along with a list of
+constraints; or the key, a list of constraints and a
+default value in case the key is missing.</p></div>
+<div class="paragraph"><p>This function will crash if the key is missing and no
+default value is provided. This function will also crash
+if a constraint fails.</p></div>
+<div class="paragraph"><p>The key must be provided as an atom. The key of the
+returned map will be that atom. The value may be converted
+through the use of constraints, making this function able
+to extract, validate and convert values all in one step.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_meta_name_req_8594_meta_name_req_undefined">meta(Name, Req) &#8594; meta(Name, Req, undefined)</h3>
+<div class="paragraph"><p>Alias for <code>cowboy_req:meta/3</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_meta_name_req_default_8594_value">meta(Name, Req, Default) &#8594; Value</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = atom()
+</dt>
+<dd>
+<p>
+Metadata name.
+</p>
+</dd>
+<dt class="hdlist1">
+Default = any()
+</dt>
+<dd>
+<p>
+Default value.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = any()
+</dt>
+<dd>
+<p>
+Metadata value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return metadata about the request.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_method_req_8594_method">method(Req) &#8594; Method</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Method = binary()
+</dt>
+<dd>
+<p>
+Request method.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the method.</p></div>
+<div class="paragraph"><p>Methods are case sensitive. Standard methods are always uppercase.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_parse_cookies_req_8594_name_value">parse_cookies(Req) &#8594; [{Name, Value}]</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = binary()
+</dt>
+<dd>
+<p>
+Cookie name.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = binary()
+</dt>
+<dd>
+<p>
+Cookie value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Parse and return all cookies.</p></div>
+<div class="paragraph"><p>Cookie names are case sensitive.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_parse_header_name_req_8594_see_below">parse_header(Name, Req) &#8594; see below</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:parse_header/3</code>.</p></div>
+<div class="paragraph"><p>The <code>parse_header/2</code> function will call <code>parser_header/3</code> with a
+different default value depending on the header being parsed. The
+following table summarizes the default values used.</p></div>
+<div class="tableblock">
+<table rules="all"
+width="100%"
+frame="border"
+cellspacing="0" cellpadding="4">
+<col width="50%" />
+<col width="50%" />
+<thead>
+<tr>
+<th align="left" valign="top"> Header name </th>
+<th align="center" valign="top"> Header value</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" valign="top"><p class="table">content-length</p></td>
+<td align="center" valign="top"><p class="table"><code>0</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">cookie</p></td>
+<td align="center" valign="top"><p class="table"><code>[]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">transfer-encoding</p></td>
+<td align="center" valign="top"><p class="table"><code>[&lt;&lt;"identity"&gt;&gt;]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">Any other header</p></td>
+<td align="center" valign="top"><p class="table"><code>undefined</code></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_parse_header_name_req_default_8594_parsedvalue_default">parse_header(Name, Req, Default) &#8594; ParsedValue | Default</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = binary()
+</dt>
+<dd>
+<p>
+Request header name.
+</p>
+</dd>
+<dt class="hdlist1">
+Default = any()
+</dt>
+<dd>
+<p>
+Default value.
+</p>
+</dd>
+<dt class="hdlist1">
+ParsedValue - see below
+</dt>
+<dd>
+<p>
+Parsed request header value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Parse the given header.</p></div>
+<div class="paragraph"><p>While header names are case insensitive, this function expects
+the name to be a lowercase binary.</p></div>
+<div class="paragraph"><p>The parsed value differs depending on the header being parsed. The
+following table summarizes the different types returned.</p></div>
+<div class="tableblock">
+<table rules="all"
+width="100%"
+frame="border"
+cellspacing="0" cellpadding="4">
+<col width="50%" />
+<col width="50%" />
+<thead>
+<tr>
+<th align="left" valign="top"> Header name </th>
+<th align="center" valign="top"> Type of parsed header value</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left" valign="top"><p class="table">accept</p></td>
+<td align="center" valign="top"><p class="table"><code>[{{Type, SubType, Params}, Quality, AcceptExt}]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">accept-charset</p></td>
+<td align="center" valign="top"><p class="table"><code>[{Charset, Quality}]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">accept-encoding</p></td>
+<td align="center" valign="top"><p class="table"><code>[{Encoding, Quality}]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">accept-language</p></td>
+<td align="center" valign="top"><p class="table"><code>[{LanguageTag, Quality}]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">authorization</p></td>
+<td align="center" valign="top"><p class="table"><code>{AuthType, Credentials}</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">content-length</p></td>
+<td align="center" valign="top"><p class="table"><code>non_neg_integer()</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">content-type</p></td>
+<td align="center" valign="top"><p class="table"><code>{Type, SubType, ContentTypeParams}</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">cookie</p></td>
+<td align="center" valign="top"><p class="table"><code>[{binary(), binary()}]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">expect</p></td>
+<td align="center" valign="top"><p class="table"><code>[Expect | {Expect, ExpectValue, Params}]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">if-match</p></td>
+<td align="center" valign="top"><p class="table"><code>'*' | [{weak | strong, OpaqueTag}]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">if-modified-since</p></td>
+<td align="center" valign="top"><p class="table"><code>calendar:datetime()</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">if-none-match</p></td>
+<td align="center" valign="top"><p class="table"><code>'*' | [{weak | strong, OpaqueTag}]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">if-unmodified-since</p></td>
+<td align="center" valign="top"><p class="table"><code>calendar:datetime()</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">range</p></td>
+<td align="center" valign="top"><p class="table"><code>{Unit, [Range]}</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">sec-websocket-protocol</p></td>
+<td align="center" valign="top"><p class="table"><code>[binary()]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">transfer-encoding</p></td>
+<td align="center" valign="top"><p class="table"><code>[binary()]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">upgrade</p></td>
+<td align="center" valign="top"><p class="table"><code>[binary()]</code></p></td>
+</tr>
+<tr>
+<td align="left" valign="top"><p class="table">x-forwarded-for</p></td>
+<td align="center" valign="top"><p class="table"><code>[binary()]</code></p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="paragraph"><p>Types for the above table:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Type = SubType = Charset = Encoding = LanguageTag = binary()
+</p>
+</li>
+<li>
+<p>
+AuthType = Expect = OpaqueTag = Unit = binary()
+</p>
+</li>
+<li>
+<p>
+Params = ContentTypeParams = [{binary(), binary()}]
+</p>
+</li>
+<li>
+<p>
+Quality = 0..1000
+</p>
+</li>
+<li>
+<p>
+AcceptExt = [{binary(), binary()} | binary()]
+</p>
+</li>
+<li>
+<p>
+Credentials - see below
+</p>
+</li>
+<li>
+<p>
+Range = {non_neg_integer(), non_neg_integer() | infinity} | neg_integer()
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>The cookie names and values, the values of the sec-websocket-protocol
+and x-forwarded-for headers, the values in <code>AcceptExt</code> and <code>Params</code>,
+the authorization <code>Credentials</code>, the <code>ExpectValue</code> and <code>OpaqueTag</code>
+are case sensitive. All values in <code>ContentTypeParams</code> are case sensitive
+except the value of the charset parameter, which is case insensitive.
+All other values are case insensitive and will be returned as lowercase.</p></div>
+<div class="paragraph"><p>The headers accept, accept-encoding and cookie headers can return
+an empty list. Some other headers are expected to have a value if provided
+and may crash if the value is missing.</p></div>
+<div class="paragraph"><p>The authorization header parsing code currently only supports basic
+HTTP authentication. The <code>Credentials</code> type is thus <code>{Username, Password}</code>
+with <code>Username</code> and <code>Password</code> being <code>binary()</code>.</p></div>
+<div class="paragraph"><p>The range header value <code>Range</code> can take three forms:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+<code>{From, To}</code>: from <code>From</code> to <code>To</code> units
+</p>
+</li>
+<li>
+<p>
+<code>{From, infinity}</code>: everything after <code>From</code> units
+</p>
+</li>
+<li>
+<p>
+<code>-Final</code>: the final <code>Final</code> units
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>An <code>undefined</code> tuple will be returned if Cowboy doesn&#8217;t know how
+to parse the requested header.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_parse_qs_req_8594_name_value">parse_qs(Req) &#8594; [{Name, Value}]</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = binary()
+</dt>
+<dd>
+<p>
+Query string field name.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = binary() | true
+</dt>
+<dd>
+<p>
+Query string field value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the request&#8217;s query string as a list of tuples.</p></div>
+<div class="paragraph"><p>The atom <code>true</code> is returned for keys which have no value.
+Keys with no value are different from keys with an empty
+value in that they do not have a <code>=</code> indicating the presence
+of a value.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_path_req_8594_path">path(Req) &#8594; Path</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Path = binary()
+</dt>
+<dd>
+<p>
+Requested path.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the requested path.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_path_info_req_8594_pathinfo">path_info(Req) &#8594; PathInfo</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+PathInfo = cowboy_router:tokens() | undefined
+</dt>
+<dd>
+<p>
+Extra tokens for the path.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the extra tokens from matching against <code>...</code> during routing.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_peer_req_8594_peer">peer(Req) &#8594; Peer</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+</dt>
+<dd>
+<p>
+Peer IP address and port number.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the client&#8217;s IP address and port number.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_port_req_8594_port">port(Req) &#8594; Port</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Port = inet:port_number()
+</dt>
+<dd>
+<p>
+Requested port number.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the request&#8217;s port.</p></div>
+<div class="paragraph"><p>The port returned by this function is obtained by parsing
+the host header. It may be different than the actual port
+the client used to connect to the Cowboy server.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_qs_req_8594_querystring">qs(Req) &#8594; QueryString</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+QueryString = binary()
+</dt>
+<dd>
+<p>
+Unprocessed query string.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the request&#8217;s query string.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_set_meta_name_value_req_8594_req2">set_meta(Name, Value, Req) &#8594; Req2</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = atom()
+</dt>
+<dd>
+<p>
+Metadata name.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = any()
+</dt>
+<dd>
+<p>
+Metadata value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Set metadata about the request.</p></div>
+<div class="paragraph"><p>An existing value will be overwritten.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_url_req_8594_url">url(Req) &#8594; URL</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+URL = binary() | undefined
+</dt>
+<dd>
+<p>
+Requested URL.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the requested URL.</p></div>
+<div class="paragraph"><p>This function will always return <code>undefined</code> until the
+<code>cowboy_router</code> middleware has been executed.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_version_req_8594_version">version(Req) &#8594; Version</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Version = cowboy:http_version()
+</dt>
+<dd>
+<p>
+Client&#8217;s advertised HTTP version.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the HTTP version used for this request.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_request_body_related_exports">Request body related exports</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_body_req_8594_body_req">body(Req) &#8594; body(Req, [])</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:body/2</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_body_req_opts_8594_ok_data_req2_more_data_req2">body(Req, Opts) &#8594; {ok, Data, Req2} | {more, Data, Req2}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Opts = [body_opt()]
+</dt>
+<dd>
+<p>
+Request body reading options.
+</p>
+</dd>
+<dt class="hdlist1">
+Data = binary()
+</dt>
+<dd>
+<p>
+Data read from the body.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Read the request body.</p></div>
+<div class="paragraph"><p>This function will read a chunk of the request body. If there is
+more data to be read after this function call, then a <code>more</code> tuple
+is returned. Otherwise an <code>ok</code> tuple is returned.</p></div>
+<div class="paragraph"><p>Cowboy will automatically send a <code>100 Continue</code> reply if
+required. If this behavior is not desirable, it can be disabled
+by setting the <code>continue</code> option to <code>false</code>.</p></div>
+<div class="paragraph"><p>Cowboy will by default attempt to read up to 8MB of the body,
+but in chunks of 1MB. It will use a timeout of 15s per chunk.
+All these values can be changed using the <code>length</code>, <code>read_length</code>
+and <code>read_timeout</code> options respectively. Note that the size
+of the data may not be the same as requested as the decoding
+functions may grow or shrink it, and Cowboy makes not attempt
+at returning an exact amount.</p></div>
+<div class="paragraph"><p>Cowboy will properly handle chunked transfer-encoding by
+default. If any other transfer-encoding or content-encoding
+has been used for the request, custom decoding functions
+can be used. The <code>content_decode</code> and <code>transfer_decode</code>
+options allow setting the decode functions manually.</p></div>
+<div class="paragraph"><p>After the body has been streamed fully, Cowboy will remove
+the transfer-encoding header from the Req object, and add
+the content-length header if it wasn&#8217;t already there.</p></div>
+<div class="paragraph"><p>This function can only be called once. Cowboy will not cache
+the result of this call.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_body_length_req_8594_length">body_length(Req) &#8594; Length</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Length = non_neg_integer() | undefined
+</dt>
+<dd>
+<p>
+Length of the request body.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the length of the request body.</p></div>
+<div class="paragraph"><p>The length will only be returned if the request does not
+use any transfer-encoding and if the content-length header
+is present.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_body_qs_req_8594_body_qs_req_length_64000_read_length_64000_read_timeout_5000">body_qs(Req) &#8594; body_qs(Req, [{length, 64000}, {read_length, 64000}, {read_timeout, 5000}])</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:body_qs/2</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_body_qs_req_opts_8594_ok_name_value_req2_badlength_req2">body_qs(Req, Opts) &#8594; {ok, [{Name, Value}], Req2} | {badlength, Req2}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Opts = [body_opt()]
+</dt>
+<dd>
+<p>
+Request body reading options.
+</p>
+</dd>
+<dt class="hdlist1">
+Name = binary()
+</dt>
+<dd>
+<p>
+Field name.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = binary() | true
+</dt>
+<dd>
+<p>
+Field value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the request body as a list of tuples.</p></div>
+<div class="paragraph"><p>This function will parse the body assuming the content-type
+application/x-www-form-urlencoded, commonly used for the
+query string.</p></div>
+<div class="paragraph"><p>This function calls <code>body/2</code> for reading the body, with the
+same options it received. By default it will attempt to read
+a body of 64KB in one chunk, with a timeout of 5s. If the
+body is larger then a <code>badlength</code> tuple is returned.</p></div>
+<div class="paragraph"><p>This function can only be called once. Cowboy will not cache
+the result of this call.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_has_body_req_8594_boolean">has_body(Req) &#8594; boolean()</h3>
+<div class="paragraph"><p>Return whether the request has a body.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_part_req_8594_part_req_length_64000_read_length_64000_read_timeout_5000">part(Req) &#8594; part(Req, [{length, 64000}, {read_length, 64000}, {read_timeout, 5000}])</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:part/2</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_part_req_opts_8594_ok_headers_req2_done_req2">part(Req, Opts) &#8594; {ok, Headers, Req2} | {done, Req2}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Opts = [body_opt()]
+</dt>
+<dd>
+<p>
+Request body reading options.
+</p>
+</dd>
+<dt class="hdlist1">
+Headers = cow_multipart:headers()
+</dt>
+<dd>
+<p>
+Part&#8217;s headers.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Read the headers for the next part of the multipart message.</p></div>
+<div class="paragraph"><p>Cowboy will skip any data remaining until the beginning of
+the next part. This includes the preamble to the multipart
+message but also the body of a previous part if it hasn&#8217;t
+been read. Both are skipped automatically when calling this
+function.</p></div>
+<div class="paragraph"><p>The headers returned are MIME headers, NOT HTTP headers.
+They can be parsed using the functions from the <code>cow_multipart</code>
+module. In addition, the <code>cow_multipart:form_data/1</code> function
+can be used to quickly figure out <code>multipart/form-data</code> messages.
+It takes the list of headers and returns whether this part is
+a simple form field or a file being uploaded.</p></div>
+<div class="paragraph"><p>Note that once a part has been read, or skipped, it cannot
+be read again.</p></div>
+<div class="paragraph"><p>This function calls <code>body/2</code> for reading the body, with the
+same options it received. By default it will only read chunks
+of 64KB with a timeout of 5s. This is tailored for reading
+part headers, not for skipping the previous part&#8217;s body.
+You might want to consider skipping large parts manually.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_part_body_req_8594_part_body_req">part_body(Req) &#8594; part_body(Req, [])</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:part_body/2</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_part_body_req_opts_8594_ok_data_req2_more_data_req2">part_body(Req, Opts) &#8594; {ok, Data, Req2} | {more, Data, Req2}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Opts = [body_opt()]
+</dt>
+<dd>
+<p>
+Request body reading options.
+</p>
+</dd>
+<dt class="hdlist1">
+Data = binary()
+</dt>
+<dd>
+<p>
+Part&#8217;s body.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Read the body of the current part of the multipart message.</p></div>
+<div class="paragraph"><p>This function calls <code>body/2</code> for reading the body, with the
+same options it received. It uses the same defaults.</p></div>
+<div class="paragraph"><p>If there are more data to be read from the socket for this
+part, the function will return what it could read inside a
+<code>more</code> tuple. Otherwise, it will return an <code>ok</code> tuple.</p></div>
+<div class="paragraph"><p>Calling this function again after receiving a <code>more</code> tuple
+will return another chunk of body. The last chunk will be
+returned inside an <code>ok</code> tuple.</p></div>
+<div class="paragraph"><p>Note that once the body has been read, fully or partially,
+it cannot be read again.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_response_related_exports">Response related exports</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_chunk_data_req_8594_ok">chunk(Data, Req) &#8594; ok</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Data = iodata()
+</dt>
+<dd>
+<p>
+Chunk data to be sent.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Send a chunk of data.</p></div>
+<div class="paragraph"><p>This function should be called as many times as needed
+to send data chunks after calling <code>chunked_reply/{2,3}</code>.</p></div>
+<div class="paragraph"><p>When the method is HEAD, no data will actually be sent.</p></div>
+<div class="paragraph"><p>If the request uses HTTP/1.0, the data is sent directly
+without wrapping it in an HTTP/1.1 chunk, providing
+compatibility with older clients.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_chunked_reply_statuscode_req_8594_chunked_reply_statuscode_req">chunked_reply(StatusCode, Req) &#8594; chunked_reply(StatusCode, [], Req)</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:chunked_reply/3</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_chunked_reply_statuscode_headers_req_8594_req2">chunked_reply(StatusCode, Headers, Req) &#8594; Req2</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+StatusCode = cowboy:http_status()
+</dt>
+<dd>
+<p>
+Response status code.
+</p>
+</dd>
+<dt class="hdlist1">
+Headers = cowboy:http_headers()
+</dt>
+<dd>
+<p>
+Response headers.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Send a response using chunked transfer-encoding.</p></div>
+<div class="paragraph"><p>This function effectively sends the response status line
+and headers to the client.</p></div>
+<div class="paragraph"><p>This function will not send any body set previously. After
+this call the handler must use the <code>chunk/2</code> function
+repeatedly to send the body in as many chunks as needed.</p></div>
+<div class="paragraph"><p>If the request uses HTTP/1.0, the data is sent directly
+without wrapping it in an HTTP/1.1 chunk, providing
+compatibility with older clients.</p></div>
+<div class="paragraph"><p>This function can only be called once, with the exception
+of overriding the response in the <code>onresponse</code> hook.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_continue_req_8594_ok">continue(Req) &#8594; ok</h3>
+<div class="paragraph"><p>Send a 100 Continue intermediate reply.</p></div>
+<div class="paragraph"><p>This reply is required before the client starts sending the
+body when the request contains the <code>expect</code> header with the
+<code>100-continue</code> value.</p></div>
+<div class="paragraph"><p>Cowboy will send this automatically when required. However
+you may want to do it manually by disabling this behavior
+with the <code>continue</code> body option and then calling this
+function.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_delete_resp_header_name_req_8594_req2">delete_resp_header(Name, Req) &#8594; Req2</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = binary()
+</dt>
+<dd>
+<p>
+Response header name.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Delete the given response header.</p></div>
+<div class="paragraph"><p>While header names are case insensitive, this function expects
+the name to be a lowercase binary.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_has_resp_body_req_8594_boolean">has_resp_body(Req) &#8594; boolean()</h3>
+<div class="paragraph"><p>Return whether a response body has been set.</p></div>
+<div class="paragraph"><p>This function will return false if a response body has
+been set with a length of 0.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_has_resp_header_name_req_8594_boolean">has_resp_header(Name, Req) &#8594; boolean()</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = binary()
+</dt>
+<dd>
+<p>
+Response header name.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return whether the given response header has been set.</p></div>
+<div class="paragraph"><p>While header names are case insensitive, this function expects
+the name to be a lowercase binary.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_reply_statuscode_req_8594_reply_statuscode_req">reply(StatusCode, Req) &#8594; reply(StatusCode, [], Req)</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:reply/3</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_reply_statuscode_headers_req_see_below">reply(StatusCode, Headers, Req) - see below</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:reply/4</code>, with caveats.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_reply_statuscode_headers_body_req_8594_req2">reply(StatusCode, Headers, Body, Req) &#8594; Req2</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+StatusCode = cowboy:http_status()
+</dt>
+<dd>
+<p>
+Response status code.
+</p>
+</dd>
+<dt class="hdlist1">
+Headers = cowboy:http_headers()
+</dt>
+<dd>
+<p>
+Response headers.
+</p>
+</dd>
+<dt class="hdlist1">
+Body = iodata()
+</dt>
+<dd>
+<p>
+Response body.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Send a response.</p></div>
+<div class="paragraph"><p>This function effectively sends the response status line,
+headers and body to the client, in a single send function
+call.</p></div>
+<div class="paragraph"><p>The <code>reply/2</code> and <code>reply/3</code> functions will send the body
+set previously, if any. The <code>reply/4</code> function overrides
+any body set previously and sends <code>Body</code> instead.</p></div>
+<div class="paragraph"><p>If a body function was set, and <code>reply/2</code> or <code>reply/3</code> was
+used, it will be called before returning.</p></div>
+<div class="paragraph"><p>No more data can be sent to the client after this function
+returns.</p></div>
+<div class="paragraph"><p>This function can only be called once, with the exception
+of overriding the response in the <code>onresponse</code> hook.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_set_resp_body_body_req_8594_req2">set_resp_body(Body, Req) &#8594; Req2</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Body = iodata()
+</dt>
+<dd>
+<p>
+Response body.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Set a response body.</p></div>
+<div class="paragraph"><p>This body will not be sent if <code>chunked_reply/{2,3}</code> or
+<code>reply/4</code> is used, as they override it.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_set_resp_body_fun_fun_req_8594_req2">set_resp_body_fun(Fun, Req) &#8594; Req2</h3>
+<div class="paragraph"><p>Alias of <code>cowboy_req:set_resp_body_fun/3</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_set_resp_body_fun_length_fun_req_8594_req2">set_resp_body_fun(Length, Fun, Req) &#8594; Req2</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Fun = fun((Socket, Transport) &#8594; ok)
+</dt>
+<dd>
+<p>
+Fun that will send the response body.
+</p>
+</dd>
+<dt class="hdlist1">
+Socket = inet:socket()
+</dt>
+<dd>
+<p>
+Socket for this connection.
+</p>
+</dd>
+<dt class="hdlist1">
+Transport = module()
+</dt>
+<dd>
+<p>
+Transport module for this socket.
+</p>
+</dd>
+<dt class="hdlist1">
+Length = non_neg_integer()
+</dt>
+<dd>
+<p>
+Length of the response body.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Set a fun for sending the response body.</p></div>
+<div class="paragraph"><p>If a <code>Length</code> is provided, it will be sent in the
+content-length header in the response. It is recommended
+to set the length if it can be known in advance. Otherwise,
+the transfer-encoding header will be set to identity.</p></div>
+<div class="paragraph"><p>This function will only be called if the response is sent
+using the <code>reply/2</code> or <code>reply/3</code> function.</p></div>
+<div class="paragraph"><p>The fun will receive the Ranch <code>Socket</code> and <code>Transport</code> as
+arguments. Only send and sendfile operations are supported.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_set_resp_body_fun_chunked_fun_req_8594_req2">set_resp_body_fun(chunked, Fun, Req) &#8594; Req2</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Fun = fun((ChunkFun) &#8594; ok)
+</dt>
+<dd>
+<p>
+Fun that will send the response body.
+</p>
+</dd>
+<dt class="hdlist1">
+ChunkFun = funiodata( &#8594; ok)
+</dt>
+<dd>
+<p>
+Fun to call for every chunk to be sent.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Set a fun for sending the response body using chunked transfer-encoding.</p></div>
+<div class="paragraph"><p>This function will only be called if the response is sent
+using the <code>reply/2</code> or <code>reply/3</code> function.</p></div>
+<div class="paragraph"><p>The fun will receive another fun as argument. This fun is to
+be used to send chunks in a similar way to the <code>chunk/2</code> function,
+except the fun only takes one argument, the data to be sent in
+the chunk.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_set_resp_cookie_name_value_opts_req_8594_req2">set_resp_cookie(Name, Value, Opts, Req) &#8594; Req2</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = iodata()
+</dt>
+<dd>
+<p>
+Cookie name.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = iodata()
+</dt>
+<dd>
+<p>
+Cookie value.
+</p>
+</dd>
+<dt class="hdlist1">
+Opts = cookie_opts()
+</dt>
+<dd>
+<p>
+Cookie options.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Set a cookie in the response.</p></div>
+<div class="paragraph"><p>Cookie names are case sensitive.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_set_resp_header_name_value_req_8594_req2">set_resp_header(Name, Value, Req) &#8594; Req2</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Name = binary()
+</dt>
+<dd>
+<p>
+Response header name.
+</p>
+</dd>
+<dt class="hdlist1">
+Value = iodata()
+</dt>
+<dd>
+<p>
+Response header value.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Set a response header.</p></div>
+<div class="paragraph"><p>You should use <code>set_resp_cookie/4</code> instead of this function
+to set cookies.</p></div>
+</div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_rest/index.html b/docs/en/cowboy/2.0/manual/cowboy_rest/index.html
new file mode 100644
index 00000000..7369592c
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_rest/index.html
@@ -0,0 +1,508 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy_rest(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy_rest(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_rest - REST handlers</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy_rest</code> module implements REST semantics on top of
+the HTTP protocol.</p></div>
+<div class="paragraph"><p>This module is a sub protocol that defines many callbacks
+be implemented by handlers. The <code>init/2</code> and <code>terminate/3</code>
+callbacks are common to all handler types and are documented
+in the manual for the <a href="cowboy_handler.asciidoc">cowboy_handler</a> module.</p></div>
+<div class="paragraph"><p>All other callbacks are optional, though some may become
+required depending on the return value of previous callbacks.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_meta_values">Meta values</h2>
+<div class="sectionbody">
+<div class="dlist"><dl>
+<dt class="hdlist1">
+charset = binary()
+</dt>
+<dd>
+<p>
+ Negotiated charset.
+ <br />
+ This value may not be defined if no charset was negotiated.
+</p>
+</dd>
+<dt class="hdlist1">
+language = binary()
+</dt>
+<dd>
+<p>
+ Negotiated language.
+ <br />
+ This value may not be defined if no language was negotiated.
+</p>
+</dd>
+<dt class="hdlist1">
+media_type = {binary(), binary(), <em>*</em> | [{binary(), binary()}]}
+</dt>
+<dd>
+<p>
+ Negotiated media-type.
+ <br />
+ The media-type is the content-type, excluding the charset.
+ <br />
+ This value is always defined after the call to
+ <code>content_types_provided/2</code>.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_terminate_reasons">Terminate reasons</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The following values may be received as the terminate reason
+in the optional <code>terminate/3</code> callback.</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+normal
+</dt>
+<dd>
+<p>
+ The connection was closed normally.
+</p>
+</dd>
+<dt class="hdlist1">
+{crash, Class, Reason}
+</dt>
+<dd>
+<p>
+ A crash occurred in the handler. <code>Class</code> and <code>Reason</code> can be
+ used to obtain more information about the crash. The function
+ <code>erlang:get_stacktrace/0</code> can also be called to obtain the
+ stacktrace of the process when the crash occurred.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_callbacks">Callbacks</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_callback_req_state_8594_value_req_state_stop_req_state">Callback(Req, State) &#8594; {Value, Req, State} | {stop, Req, State}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Callback
+</dt>
+<dd>
+<p>
+One of the REST callbacks described below.
+</p>
+</dd>
+<dt class="hdlist1">
+Req = cowboy_req:req()
+</dt>
+<dd>
+<p>
+The Req object.
+</p>
+</dd>
+<dt class="hdlist1">
+State = any()
+</dt>
+<dd>
+<p>
+Handler state.
+</p>
+</dd>
+<dt class="hdlist1">
+Value
+</dt>
+<dd>
+<p>
+See the REST callbacks description below.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Please see the REST callbacks description below for details
+on the <code>Value</code> type, the default value if the callback is
+not defined, and more general information on when the
+callback is called and what its intended use is.</p></div>
+<div class="paragraph"><p>The <code>stop</code> tuple can be returned to stop REST processing.
+It is up to the resource code to send a reply before that,
+otherwise a <code>204 No Content</code> will be sent.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_rest_callbacks_description">REST callbacks description</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_allowed_methods">allowed_methods</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Methods
+</dt>
+<dd>
+<p>
+all
+</p>
+</dd>
+<dt class="hdlist1">
+Value type
+</dt>
+<dd>
+<p>
+[binary()]
+</p>
+</dd>
+<dt class="hdlist1">
+Default value
+</dt>
+<dd>
+<p>
+<code>[&lt;&lt;"GET"&gt;&gt;, &lt;&lt;"HEAD"&gt;&gt;, &lt;&lt;"OPTIONS"&gt;&gt;]</code>
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the list of allowed methods.</p></div>
+<div class="paragraph"><p>Methods are case sensitive. Standard methods are always uppercase.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_allow_missing_post">allow_missing_post</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Methods
+</dt>
+<dd>
+<p>
+POST
+</p>
+</dd>
+<dt class="hdlist1">
+Value type
+</dt>
+<dd>
+<p>
+boolean()
+</p>
+</dd>
+<dt class="hdlist1">
+Default value
+</dt>
+<dd>
+<p>
+true
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return whether POST is allowed when the resource doesn&#8217;t exist.</p></div>
+<div class="paragraph"><p>Returning <code>true</code> here means that a new resource will be
+created. The URL to the created resource should also be
+returned from the <code>AcceptResource</code> callback.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_charsets_provided">charsets_provided</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Methods
+</dt>
+<dd>
+<p>
+GET, HEAD, POST, PUT, PATCH, DELETE
+</p>
+</dd>
+<dt class="hdlist1">
+Value type
+</dt>
+<dd>
+<p>
+[binary()]
+</p>
+</dd>
+<dt class="hdlist1">
+Default behavior
+</dt>
+<dd>
+<p>
+Skip to the next step if undefined.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Return the list of charsets the resource provides.</p></div>
+<div class="paragraph"><p>The list must be ordered in order of preference.</p></div>
+<div class="paragraph"><p>If the accept-charset header was not sent, the first charset
+in the list will be selected. Otherwise Cowboy will select
+the most appropriate charset from the list.</p></div>
+<div class="paragraph"><p>The chosen charset will be set in the <code>Req</code> object as the meta
+value <code>charset</code>.</p></div>
+<div class="paragraph"><p>While charsets are case insensitive, this callback is expected
+to return them as lowercase binary.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_content_types_accepted">content_types_accepted</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Methods
+</dt>
+<dd>
+<p>
+POST, PUT, PATCH
+</p>
+</dd>
+<dt class="hdlist1">
+Value type
+</dt>
+<dd>
+<p>
+[{binary() | {Type, SubType, Params}, AcceptResource}]
+</p>
+</dd>
+<dt class="hdlist1">
+Default behavior
+</dt>
+<dd>
+<p>
+Crash if undefined.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>With types:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Type = SubType = binary()
+</p>
+</li>
+<li>
+<p>
+Params = <em>*</em> | [{binary(), binary()}]
+</p>
+</li>
+<li>
+<p>
+AcceptResource = atom()
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>Return the list of content-types the resource accepts.</p></div>
+<div class="paragraph"><p>The list must be ordered in order of preference.</p></div>
+<div class="paragraph"><p>Each content-type can be given either as a binary string or as
+a tuple containing the type, subtype and parameters.</p></div>
+<div class="paragraph"><p>Cowboy will select the most appropriate content-type from the list.
+If any parameter is acceptable, then the tuple form should be used
+with parameters set to <code>'*'</code>. If the parameters value is set to <code>[]</code>
+only content-type values with no parameters will be accepted. All
+parameter values are treated in a case sensitive manner except the
+<code>charset</code> parameter, if present, which is case insensitive.</p></div>
+<div class="paragraph"><p>This function will be called for POST, PUT and PATCH requests.
+It is entirely possible to define different callbacks for different
+methods if the handling of the request differs. Simply verify
+what the method is with <code>cowboy_req:method/1</code> and return a
+different list for each methods.</p></div>
+<div class="paragraph"><p>The <code>AcceptResource</code> value is the name of the callback that will
+be called if the content-type matches. It is defined as follows.</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Value type
+</dt>
+<dd>
+<p>
+true | {true, URL} | false
+</p>
+</dd>
+<dt class="hdlist1">
+Default behavior
+</dt>
+<dd>
+<p>
+Crash if undefined.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Process the request body.</p></div>
+<div class="paragraph"><p>This function should create or update the resource with the
+information contained in the request body. This information
+may be full or partial depending on the request method.</p></div>
+<div class="paragraph"><p>If the request body was processed successfully, <code>true</code> must
+be returned. If the request method is POST, <code>{true, URL}</code> may
+be returned instead, and Cowboy will redirect the client to
+the location of the newly created resource.</p></div>
+<div class="paragraph"><p>If a response body must be sent, the appropriate media-type, charset
+and language can be retrieved using the <code>cowboy_req:meta/{2,3}</code>
+functions. The respective keys are <code>media_type</code>, <code>charset</code>
+and <code>language</code>. The body can be set using <code>cowboy_req:set_resp_body/2</code>.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_content_types_provided">content_types_provided</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Methods
+</dt>
+<dd>
+<p>
+GET, HEAD, POST, PUT, PATCH, DELETE
+</p>
+</dd>
+<dt class="hdlist1">
+Value type
+</dt>
+<dd>
+<p>
+[{binary() | {Type, SubType, Params}, ProvideResource}]
+</p>
+</dd>
+<dt class="hdlist1">
+Default value
+</dt>
+<dd>
+<p>
+`[
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_router/index.html b/docs/en/cowboy/2.0/manual/cowboy_router/index.html
new file mode 100644
index 00000000..bdf6eb01
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_router/index.html
@@ -0,0 +1,247 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy_router(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy_router(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_router - router middleware</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy_router</code> middleware maps the requested host and
+path to the handler to be used for processing the request.
+It uses the dispatch rules compiled from the routes given
+to the <code>compile/1</code> function for this purpose. It adds the
+handler name and options to the environment as the values
+<code>handler</code> and <code>handler_opts</code> respectively.</p></div>
+<div class="sect2">
+<h3 id="_environment_input">Environment input</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+dispatch = dispatch_rules()
+</dt>
+<dd>
+<p>
+Dispatch table.
+</p>
+</dd>
+</dl></div>
+</div>
+<div class="sect2">
+<h3 id="_environment_output">Environment output</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+handler = module()
+</dt>
+<dd>
+<p>
+Handler module.
+</p>
+</dd>
+<dt class="hdlist1">
+handler_opts = any()
+</dt>
+<dd>
+<p>
+Handler options.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_types">Types</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_bindings_atom_binary">bindings() = [{atom(), binary()}]</h3>
+<div class="paragraph"><p>List of bindings found during routing.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_dispatch_rules_opaque_to_the_user">dispatch_rules() - opaque to the user</h3>
+<div class="paragraph"><p>Rules for dispatching request used by Cowboy.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_routes_host_paths_host_cowboy_fields_paths">routes() = [{Host, Paths} | {Host, cowboy:fields(), Paths}]</h3>
+<div class="paragraph"><p>With types:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Host = Path = <em>_</em> | iodata()
+</p>
+</li>
+<li>
+<p>
+Paths = [{Path, Handler, Opts} | {Path, cowboy:fields(), Handler, HandlerOpts}]
+</p>
+</li>
+<li>
+<p>
+Handler = module()
+</p>
+</li>
+<li>
+<p>
+HandlerOpts = any()
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>Human readable list of routes mapping hosts and paths to handlers.</p></div>
+<div class="paragraph"><p>The syntax for routes is defined in the user guide.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_tokens_binary">tokens() = [binary()]</h3>
+<div class="paragraph"><p>List of host_info and path_info tokens found during routing.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_exports">Exports</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_compile_routes_8594_dispatch_rules">compile(routes()) &#8594; dispatch_rules()</h3>
+<div class="paragraph"><p>Compile the routes for use by Cowboy.</p></div>
+</div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_static/index.html b/docs/en/cowboy/2.0/manual/cowboy_static/index.html
new file mode 100644
index 00000000..62929c59
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_static/index.html
@@ -0,0 +1,188 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy_static(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy_static(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_static - static file handler</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy_static</code> module implements file serving capabilities
+by using the REST semantics provided by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_types">Types</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_opts_option">opts() = [Option]</h3>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="color: #009900">Option</span> <span style="color: #990000">=</span> {<span style="color: #FF6600">priv_file</span>, <span style="font-weight: bold"><span style="color: #000080">atom</span></span>(), <span style="font-weight: bold"><span style="color: #000000">string</span></span>() | <span style="font-weight: bold"><span style="color: #000080">binary</span></span>()}
+ | {<span style="color: #FF6600">priv_file</span>, <span style="font-weight: bold"><span style="color: #000080">atom</span></span>(), <span style="font-weight: bold"><span style="color: #000000">string</span></span>() | <span style="font-weight: bold"><span style="color: #000080">binary</span></span>(), <span style="color: #009900">Extra</span>}
+ | {<span style="color: #FF6600">file</span>, <span style="font-weight: bold"><span style="color: #000000">string</span></span>() | <span style="font-weight: bold"><span style="color: #000080">binary</span></span>()}
+ | {<span style="color: #FF6600">file</span>, <span style="font-weight: bold"><span style="color: #000000">string</span></span>() | <span style="font-weight: bold"><span style="color: #000080">binary</span></span>(), <span style="color: #009900">Extra</span>}
+ | {<span style="color: #FF6600">priv_dir</span>, <span style="font-weight: bold"><span style="color: #000080">atom</span></span>(), <span style="font-weight: bold"><span style="color: #000000">string</span></span>() | <span style="font-weight: bold"><span style="color: #000080">binary</span></span>()}
+ | {<span style="color: #FF6600">priv_dir</span>, <span style="font-weight: bold"><span style="color: #000080">atom</span></span>(), <span style="font-weight: bold"><span style="color: #000000">string</span></span>() | <span style="font-weight: bold"><span style="color: #000080">binary</span></span>(), <span style="color: #009900">Extra</span>}
+ | {<span style="color: #FF6600">dir</span>, <span style="font-weight: bold"><span style="color: #000000">string</span></span>() | <span style="font-weight: bold"><span style="color: #000080">binary</span></span>()}
+ | {<span style="color: #FF6600">dir</span>, <span style="font-weight: bold"><span style="color: #000000">string</span></span>() | <span style="font-weight: bold"><span style="color: #000080">binary</span></span>(), <span style="color: #009900">Extra</span>}
+
+<span style="color: #009900">Extra</span> <span style="color: #990000">=</span> [<span style="color: #009900">ETag</span> | <span style="color: #009900">Mimetypes</span>]
+
+<span style="color: #009900">ETag</span> <span style="color: #990000">=</span> {<span style="color: #FF6600">etag</span>, <span style="font-weight: bold"><span style="color: #000000">module</span></span>(), <span style="font-weight: bold"><span style="color: #000080">function</span></span>()} | {<span style="color: #FF6600">etag</span>, <span style="color: #000080">false</span>}
+
+<span style="color: #009900">Mimetypes</span> <span style="color: #990000">=</span> {<span style="color: #FF6600">mimetypes</span>, <span style="font-weight: bold"><span style="color: #000000">module</span></span>(), <span style="font-weight: bold"><span style="color: #000080">function</span></span>()}
+ | {<span style="color: #FF6600">mimetypes</span>, <span style="font-weight: bold"><span style="color: #000080">binary</span></span>() | {<span style="font-weight: bold"><span style="color: #000080">binary</span></span>(), <span style="font-weight: bold"><span style="color: #000080">binary</span></span>(), [{<span style="font-weight: bold"><span style="color: #000080">binary</span></span>(), <span style="font-weight: bold"><span style="color: #000080">binary</span></span>()}]}}</tt></pre></div></div>
+<div class="paragraph"><p>Configuration for the static handler.</p></div>
+<div class="paragraph"><p>The handler can be configured for sending either one file or
+a directory (including its subdirectories).</p></div>
+<div class="paragraph"><p>Extra options allow you to define how the etag should be calculated
+and how the mimetype of files should be detected.</p></div>
+</div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_sub_protocol/index.html b/docs/en/cowboy/2.0/manual/cowboy_sub_protocol/index.html
new file mode 100644
index 00000000..9559d6c4
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_sub_protocol/index.html
@@ -0,0 +1,224 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy_sub_protocol(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy_sub_protocol(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_sub_protocol - sub protocol</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy_sub_protocol</code> behaviour defines the interface used
+by modules that implement a protocol on top of HTTP.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_callbacks">Callbacks</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_upgrade_req_env_handler_handleropts_8594_ok_req_env_suspend_module_function_args_stop_req">upgrade(Req, Env, Handler, HandlerOpts) &#8594; {ok, Req, Env} | {suspend, Module, Function, Args} | {stop, Req}</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Req = cowboy_req:req()
+</dt>
+<dd>
+<p>
+The Req object.
+</p>
+</dd>
+<dt class="hdlist1">
+Env = env()
+</dt>
+<dd>
+<p>
+The request environment.
+</p>
+</dd>
+<dt class="hdlist1">
+Handler = module()
+</dt>
+<dd>
+<p>
+Handler module.
+</p>
+</dd>
+<dt class="hdlist1">
+Opts = any()
+</dt>
+<dd>
+<p>
+Handler options.
+</p>
+</dd>
+<dt class="hdlist1">
+Module = module()
+</dt>
+<dd>
+<p>
+MFA to call when resuming the process.
+</p>
+</dd>
+<dt class="hdlist1">
+Function = atom()
+</dt>
+<dd>
+<p>
+MFA to call when resuming the process.
+</p>
+</dd>
+<dt class="hdlist1">
+Args = [any()]
+</dt>
+<dd>
+<p>
+MFA to call when resuming the process.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Upgrade the protocol.</p></div>
+<div class="paragraph"><p>Please refer to the <code>cowboy_middleware</code> manual for a
+description of the return values.</p></div>
+</div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/cowboy_websocket/index.html b/docs/en/cowboy/2.0/manual/cowboy_websocket/index.html
new file mode 100644
index 00000000..8b3790c4
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/cowboy_websocket/index.html
@@ -0,0 +1,352 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: cowboy_websocket(3)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>cowboy_websocket(3)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>cowboy_websocket - Websocket protocol</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The <code>cowboy_websocket</code> module implements the Websocket protocol.</p></div>
+<div class="paragraph"><p>This module is a sub protocol that defines four callbacks to
+be implemented by handlers. The <code>init/2</code> and <code>terminate/3</code>
+callbacks are common to all handler types and are documented
+in the manual for the <a href="cowboy_handler.asciidoc">cowboy_handler</a> module.</p></div>
+<div class="paragraph"><p>The <code>websocket_handle/3</code> and <code>websocket_info/3</code> callbacks are
+specific to Websocket handlers and will be called as many times
+as necessary until the Websocket connection is closed.</p></div>
+<div class="paragraph"><p>The <code>init/2</code> callback can be used to negotiate Websocket protocol
+extensions with the client. It is highly recommended to return a
+timeout value from this callback to ensure that the process is
+terminated when no data has been received during that timespan.
+The default timeout is <code>infinity</code>, which should only be used if
+you have alternate means of ending inactive connections.</p></div>
+<div class="paragraph"><p>Cowboy will terminate the process right after closing the
+Websocket connection. This means that there is no real need to
+perform any cleanup in the optional <code>terminate/3</code> callback.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_meta_values">Meta values</h2>
+<div class="sectionbody">
+<div class="dlist"><dl>
+<dt class="hdlist1">
+websocket_compress = boolean()
+</dt>
+<dd>
+<p>
+ Whether a websocket compression extension in in use.
+</p>
+</dd>
+<dt class="hdlist1">
+websocket_version = 7 | 8 | 13
+</dt>
+<dd>
+<p>
+ The version of the Websocket protocol being used.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_terminate_reasons">Terminate reasons</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The following values may be received as the terminate reason
+in the optional <code>terminate/3</code> callback.</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+normal
+</dt>
+<dd>
+<p>
+ The connection was closed normally before establishing a Websocket
+ connection. This typically happens if an <code>ok</code> tuple is returned
+ from the <code>init/2</code> callback.
+</p>
+</dd>
+<dt class="hdlist1">
+remote
+</dt>
+<dd>
+<p>
+ The remote endpoint closed the connection without giving any
+ further details.
+</p>
+</dd>
+<dt class="hdlist1">
+{remote, Code, Payload}
+</dt>
+<dd>
+<p>
+ The remote endpoint closed the connection with the given
+ <code>Code</code> and <code>Payload</code> as the reason.
+</p>
+</dd>
+<dt class="hdlist1">
+stop
+</dt>
+<dd>
+<p>
+ The handler requested to close the connection, either by returning
+ a <code>stop</code> tuple or by sending a <code>close</code> frame.
+</p>
+</dd>
+<dt class="hdlist1">
+timeout
+</dt>
+<dd>
+<p>
+ The connection has been closed due to inactivity. The timeout
+ value can be configured from <code>init/2</code>.
+</p>
+</dd>
+<dt class="hdlist1">
+{crash, Class, Reason}
+</dt>
+<dd>
+<p>
+ A crash occurred in the handler. <code>Class</code> and <code>Reason</code> can be
+ used to obtain more information about the crash. The function
+ <code>erlang:get_stacktrace/0</code> can also be called to obtain the
+ stacktrace of the process when the crash occurred.
+</p>
+</dd>
+<dt class="hdlist1">
+{error, badencoding}
+</dt>
+<dd>
+<p>
+ A text frame was sent by the client with invalid encoding. All
+ text frames must be valid UTF-8.
+</p>
+</dd>
+<dt class="hdlist1">
+{error, badframe}
+</dt>
+<dd>
+<p>
+ A protocol error has been detected.
+</p>
+</dd>
+<dt class="hdlist1">
+{error, closed}
+</dt>
+<dd>
+<p>
+ The socket has been closed brutally without a close frame being
+ received first.
+</p>
+</dd>
+<dt class="hdlist1">
+{error, Reason}
+</dt>
+<dd>
+<p>
+ A socket error ocurred.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_callbacks">Callbacks</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_websocket_handle_inframe_req_state_8594_ret">websocket_handle(InFrame, Req, State) &#8594; Ret</h3>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="color: #009900">Ret</span> <span style="color: #990000">=</span> {<span style="color: #FF6600">ok</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}
+ | {<span style="color: #FF6600">ok</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>, <span style="color: #FF6600">hibernate</span>}
+ | {<span style="color: #FF6600">reply</span>, <span style="color: #009900">OutFrame</span> | [<span style="color: #009900">OutFrame</span>], <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}
+ | {<span style="color: #FF6600">reply</span>, <span style="color: #009900">OutFrame</span> | [<span style="color: #009900">OutFrame</span>], <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>, <span style="color: #FF6600">hibernate</span>}
+ | {<span style="color: #FF6600">stop</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}
+
+<span style="color: #009900">InFrame</span> <span style="color: #990000">=</span> {<span style="color: #FF6600">text</span> | <span style="font-weight: bold"><span style="color: #000080">binary</span></span> | <span style="color: #FF6600">ping</span> | <span style="color: #FF6600">pong</span>, <span style="font-weight: bold"><span style="color: #000080">binary</span></span>()}
+<span style="color: #009900">Req</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:req</span></span>()
+<span style="color: #009900">State</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">any</span></span>()
+<span style="color: #009900">OutFrame</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cow_ws:frame</span></span>()</tt></pre></div></div>
+<div class="paragraph"><p>Handle the data received from the Websocket connection.</p></div>
+<div class="paragraph"><p>This function will be called every time data is received
+from the Websocket connection.</p></div>
+<div class="paragraph"><p>The <code>stop</code> return value can be used to close the
+connection. A close reply will also result in the connection
+being closed.</p></div>
+<div class="paragraph"><p>The <code>hibernate</code> option will hibernate the process until
+it receives new data from the Websocket connection or an
+Erlang message.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_websocket_info_info_req_state_8594_ret">websocket_info(Info, Req, State) &#8594; Ret</h3>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="color: #009900">Ret</span> <span style="color: #990000">=</span> {<span style="color: #FF6600">ok</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}
+ | {<span style="color: #FF6600">ok</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>, <span style="color: #FF6600">hibernate</span>}
+ | {<span style="color: #FF6600">reply</span>, <span style="color: #009900">OutFrame</span> | [<span style="color: #009900">OutFrame</span>], <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}
+ | {<span style="color: #FF6600">reply</span>, <span style="color: #009900">OutFrame</span> | [<span style="color: #009900">OutFrame</span>], <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>, <span style="color: #FF6600">hibernate</span>}
+ | {<span style="color: #FF6600">stop</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}
+
+<span style="color: #009900">Info</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">any</span></span>()
+<span style="color: #009900">Req</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:req</span></span>()
+<span style="color: #009900">State</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">any</span></span>()
+<span style="color: #009900">OutFrame</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cow_ws:frame</span></span>()</tt></pre></div></div>
+<div class="paragraph"><p>Handle the Erlang message received.</p></div>
+<div class="paragraph"><p>This function will be called every time an Erlang message
+has been received. The message can be any Erlang term.</p></div>
+<div class="paragraph"><p>The <code>stop</code> return value can be used to close the
+connection. A close reply will also result in the connection
+being closed.</p></div>
+<div class="paragraph"><p>The <code>hibernate</code> option will hibernate the process until
+it receives another message or new data from the Websocket
+connection.</p></div>
+</div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/http_status_codes/index.html b/docs/en/cowboy/2.0/manual/http_status_codes/index.html
new file mode 100644
index 00000000..1af04219
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/http_status_codes/index.html
@@ -0,0 +1,407 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: HTTP status codes(7)</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>HTTP status codes(7)</span></h1>
+
+<div class="sect1">
+<h2 id="_name">Name</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>HTTP status codes - status codes used by Cowboy</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_description">Description</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>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.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_100_continue">100 Continue</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>When the client sends an <code>expect: 100-continue</code> 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.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_101_switching_protocols">101 Switching Protocols</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This is the status code sent when switching to the
+Websocket protocol.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_200_ok">200 OK</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_201_created">201 Created</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_202_accepted">202 Accepted</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_204_no_content">204 No Content</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent when the processing of a request
+ends without any reply having been sent. It may also be
+sent by <code>cowboy_rest</code> under normal conditions.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_300_multiple_choices">300 Multiple Choices</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_301_moved_permanently">301 Moved Permanently</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_303_see_other">303 See Other</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_304_not_modified">304 Not Modified</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_307_temporary_redirect">307 Temporary Redirect</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_400_bad_request">400 Bad Request</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Cowboy will send this status code for any of the
+following reasons:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Too many empty lines were sent before the request.
+</p>
+</li>
+<li>
+<p>
+The request-line could not be parsed.
+</p>
+</li>
+<li>
+<p>
+Too many headers were sent.
+</p>
+</li>
+<li>
+<p>
+A header name was too long.
+</p>
+</li>
+<li>
+<p>
+A header value was too long.
+</p>
+</li>
+<li>
+<p>
+The host header was missing from an HTTP/1.1 request.
+</p>
+</li>
+<li>
+<p>
+The host header could not be parsed.
+</p>
+</li>
+<li>
+<p>
+The requested host was not found.
+</p>
+</li>
+<li>
+<p>
+The requested path could not be parsed.
+</p>
+</li>
+<li>
+<p>
+The accept header could not be parsed when using REST.
+</p>
+</li>
+<li>
+<p>
+REST under normal conditions.
+</p>
+</li>
+<li>
+<p>
+A Websocket upgrade failed.
+</p>
+</li>
+</ul></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_401_unauthorized">401 Unauthorized</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_403_forbidden">403 Forbidden</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_404_not_found">404 Not Found</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent when the router successfully
+resolved the host but didn&#8217;t find a matching path for
+the request. It may also be sent by <code>cowboy_rest</code> under
+normal conditions.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_405_method_not_allowed">405 Method Not Allowed</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_406_not_acceptable">406 Not Acceptable</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_408_request_timeout">408 Request Timeout</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>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.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_409_conflict">409 Conflict</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_410_gone">410 Gone</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_412_precondition_failed">412 Precondition Failed</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_413_request_entity_too_large">413 Request Entity Too Large</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_414_request_uri_too_long">414 Request-URI Too Long</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Cowboy will send this status code to the client if the
+request-line is too long. It may also be sent by
+<code>cowboy_rest</code> under normal conditions.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_415_unsupported_media_type">415 Unsupported Media Type</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_500_internal_server_error">500 Internal Server Error</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>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 <code>cowboy_rest</code> under
+normal conditions.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_501_not_implemented">501 Not Implemented</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_503_service_unavailable">503 Service Unavailable</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This status code is sent by <code>cowboy_rest</code>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_505_http_version_not_supported">505 HTTP Version Not Supported</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>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.</p></div>
+</div>
+</div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+
diff --git a/docs/en/cowboy/2.0/manual/index.html b/docs/en/cowboy/2.0/manual/index.html
new file mode 100644
index 00000000..2751944d
--- /dev/null
+++ b/docs/en/cowboy/2.0/manual/index.html
@@ -0,0 +1,209 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">
+
+ <meta name="generator" content="Hugo 0.15" />
+
+ <title>Nine Nines: Cowboy Function Reference</title>
+
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+
+ <link href="/css/bootstrap.min.css" rel="stylesheet">
+ <link href="/css/99s.css" rel="stylesheet">
+
+ <link rel="shortcut icon" href="/img/ico/favicon.ico">
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
+ <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">
+
+
+</head>
+
+
+<body class="">
+ <header id="page-head">
+ <div id="topbar" class="container">
+ <div class="row">
+ <div class="span2">
+ <h1 id="logo"><a href="/" title="99s">99s</a></h1>
+ </div>
+ <div class="span10">
+
+ <div id="side-header">
+ <nav>
+ <ul>
+ <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
+ <li><a title="Watch my talks" href="/talks">Talks</a></li>
+ <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
+ <li><a title="Request my services" href="/services">Consulting & Training</a></li>
+ </ul>
+ </nav>
+ <ul id="social">
+ <li>
+ <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
+ </li>
+ <li>
+ <a title="Keep in touch!" href="http://twitter.com/lhoguin"><img src="/img/ico_microblog.png" data-hover="/img/ico_microblog_alt.png"></a>
+ </li>
+ <li>
+ <a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</header>
+
+<div id="contents" class="two_col">
+<div class="container">
+<div class="row">
+<div id="docs" class="span9 maincol">
+
+<h1 class="lined-header"><span>Cowboy Function Reference</span></h1>
+
+<div class="ulist"><ul>
+<li>
+<p>
+<a href="cowboy_app">cowboy(7)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy">cowboy(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy_handler">cowboy_handler(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy_loop">cowboy_loop(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy_middleware">cowboy_middleware(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy_protocol">cowboy_protocol(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy_req">cowboy_req(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy_rest">cowboy_rest(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy_router">cowboy_router(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy_static">cowboy_static(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy_sub_protocol">cowboy_sub_protocol(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="cowboy_websocket">cowboy_websocket(3)</a>
+</p>
+</li>
+<li>
+<p>
+<a href="http_status_codes">HTTP status codes(7)</a>
+</p>
+</li>
+</ul></div>
+
+
+
+</div>
+
+<div class="span3 sidecol">
+
+
+<h3>
+ Cowboy
+ 2.0
+ Function Reference
+
+</h3>
+
+<ul>
+
+ <li><a href="/docs/en/cowboy/2.0/guide">User Guide</a></li>
+
+
+ <li><a href="/docs/en/cowboy/2.0/manual">Function Reference</a></li>
+
+
+</ul>
+
+<h4 id="docs-nav">Navigation</h4>
+
+<h4>Version select</h4>
+<ul>
+
+
+
+ <li><a href="/docs/en/cowboy/1.0/manual">1.0</a></li>
+
+ <li><a href="/docs/en/cowboy/2.0/manual">2.0</a></li>
+
+</ul>
+
+</div>
+</div>
+</div>
+</div>
+
+ <footer>
+ <div class="container">
+ <div class="row">
+ <div class="span6">
+ <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
+ <nav>
+ <ul>
+ <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
+ </ul>
+ </nav>
+ </div>
+ <div class="span6 credits">
+ <p><img src="/img/footer_logo.png"></p>
+ <p>Copyright &copy; Loïc Hoguin 2012-2016</p>
+ </div>
+ </div>
+ </div>
+ </footer>
+
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script src="/js/bootstrap-carousel.js"></script>
+ <script src="/js/bootstrap-dropdown.js"></script>
+ <script src="/js/custom.js"></script>
+ </body>
+</html>
+
+