Bug 965869 (part 2) - HTTP/2 draft10 tests. r=mcmanus
authorNicholas Hurley <hurley@todesschaf.org>
Wed, 26 Mar 2014 10:58:11 -0700
changeset 182211 70a43999d28d1547d81ee943c38b210ea1af2cd0
parent 182210 66007409ca35a066dcc26a66f92713378397df24
child 182212 52aaac0d7caeb843ef2ec92c2e747a076720f6f3
push idunknown
push userunknown
push dateunknown
reviewersmcmanus
bugs965869
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 965869 (part 2) - HTTP/2 draft10 tests. r=mcmanus
netwerk/test/unit/test_http2.js
testing/xpcshell/node-http2/HISTORY.md
testing/xpcshell/node-http2/README.md
testing/xpcshell/node-http2/doc/docco.css
testing/xpcshell/node-http2/doc/http.html
testing/xpcshell/node-http2/doc/index.html
testing/xpcshell/node-http2/doc/public/fonts/aller-bold.eot
testing/xpcshell/node-http2/doc/public/fonts/aller-bold.ttf
testing/xpcshell/node-http2/doc/public/fonts/aller-bold.woff
testing/xpcshell/node-http2/doc/public/fonts/aller-light.eot
testing/xpcshell/node-http2/doc/public/fonts/aller-light.ttf
testing/xpcshell/node-http2/doc/public/fonts/aller-light.woff
testing/xpcshell/node-http2/doc/public/fonts/novecento-bold.eot
testing/xpcshell/node-http2/doc/public/fonts/novecento-bold.ttf
testing/xpcshell/node-http2/doc/public/fonts/novecento-bold.woff
testing/xpcshell/node-http2/doc/public/stylesheets/normalize.css
testing/xpcshell/node-http2/lib/http.js
testing/xpcshell/node-http2/lib/index.js
testing/xpcshell/node-http2/node_modules/http2-protocol/.gitignore
testing/xpcshell/node-http2/node_modules/http2-protocol/HISTORY.md
testing/xpcshell/node-http2/node_modules/http2-protocol/README.md
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/compressor.html
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/connection.html
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/docco.css
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/endpoint.html
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/flow.html
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/framer.html
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/index.html
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/public/fonts/aller-bold.eot
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/public/fonts/aller-bold.ttf
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/public/fonts/aller-bold.woff
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/public/fonts/aller-light.eot
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/public/fonts/aller-light.ttf
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/public/fonts/aller-light.woff
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/public/fonts/novecento-bold.eot
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/public/fonts/novecento-bold.ttf
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/public/fonts/novecento-bold.woff
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/public/stylesheets/normalize.css
testing/xpcshell/node-http2/node_modules/http2-protocol/doc/stream.html
testing/xpcshell/node-http2/node_modules/http2-protocol/example/client.js
testing/xpcshell/node-http2/node_modules/http2-protocol/example/server.js
testing/xpcshell/node-http2/node_modules/http2-protocol/lib/compressor.js
testing/xpcshell/node-http2/node_modules/http2-protocol/lib/connection.js
testing/xpcshell/node-http2/node_modules/http2-protocol/lib/flow.js
testing/xpcshell/node-http2/node_modules/http2-protocol/lib/framer.js
testing/xpcshell/node-http2/node_modules/http2-protocol/lib/index.js
testing/xpcshell/node-http2/node_modules/http2-protocol/lib/stream.js
testing/xpcshell/node-http2/node_modules/http2-protocol/package.json
testing/xpcshell/node-http2/node_modules/http2-protocol/test/compressor.js
testing/xpcshell/node-http2/node_modules/http2-protocol/test/connection.js
testing/xpcshell/node-http2/node_modules/http2-protocol/test/flow.js
testing/xpcshell/node-http2/node_modules/http2-protocol/test/framer.js
testing/xpcshell/node-http2/node_modules/http2-protocol/test/stream.js
testing/xpcshell/node-http2/node_modules/http2-protocol/test/util.js
testing/xpcshell/node-http2/package.json
--- a/netwerk/test/unit/test_http2.js
+++ b/netwerk/test/unit/test_http2.js
@@ -20,17 +20,17 @@ posts.push(generateContent(250000));
 var md5s = ['f1b708bba17f1ce948dc979f4d7092bc',
             '2ef8d3b6c8f329318eb1a119b12622b6'];
 
 var bigListenerData = generateContent(128 * 1024);
 var bigListenerMD5 = '8f607cfdd2c87d6a7eedb657dafbd836';
 
 function checkIsHttp2(request) {
   try {
-    if (request.getResponseHeader("X-Firefox-Spdy") == "HTTP-draft-09/2.0") {
+    if (request.getResponseHeader("X-Firefox-Spdy") == "h2-10") {
       if (request.getResponseHeader("X-Connection-Http2") == "yes") {
         return true;
       }
       return false; // Weird case, but the server disagrees with us
     }
   } catch (e) {
     // Nothing to do here
   }
@@ -432,17 +432,17 @@ function run_test() {
 
   addCertOverride("localhost", 6944,
                   Ci.nsICertOverrideService.ERROR_UNTRUSTED |
                   Ci.nsICertOverrideService.ERROR_MISMATCH |
                   Ci.nsICertOverrideService.ERROR_TIME);
 
   prefs.setIntPref("network.http.speculative-parallel-limit", oldPref);
 
-  // Enable all versions of spdy to see that we auto negotiate spdy/3
+  // Enable all versions of spdy to see that we auto negotiate http/2
   spdypref = prefs.getBoolPref("network.http.spdy.enabled");
   spdy3pref = prefs.getBoolPref("network.http.spdy.enabled.v3");
   spdypush = prefs.getBoolPref("network.http.spdy.allow-push");
   http2pref = prefs.getBoolPref("network.http.spdy.enabled.http2draft");
   prefs.setBoolPref("network.http.spdy.enabled", true);
   prefs.setBoolPref("network.http.spdy.enabled.v3", true);
   prefs.setBoolPref("network.http.spdy.allow-push", true);
   prefs.setBoolPref("network.http.spdy.enabled.http2draft", true);
--- a/testing/xpcshell/node-http2/HISTORY.md
+++ b/testing/xpcshell/node-http2/HISTORY.md
@@ -1,11 +1,17 @@
 Version history
 ===============
 
+### 2.3.0 (2014-03-10) ###
+
+* Upgrade to the latest draft: [draft-ietf-httpbis-http2-10]
+
+[draft-ietf-httpbis-http2-10]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-10
+
 ### 2.2.0 (2013-12-25) ###
 
 * Upgrade to the latest draft: [draft-ietf-httpbis-http2-09]
 * [Tarball](https://github.com/molnarg/node-http2/archive/node-http2-2.2.0.tar.gz)
 
 [draft-ietf-httpbis-http2-09]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-09
 
 ### 2.1.1 (2013-12-21) ###
--- a/testing/xpcshell/node-http2/README.md
+++ b/testing/xpcshell/node-http2/README.md
@@ -1,12 +1,12 @@
 node-http2
 ==========
 
-An HTTP/2 ([draft-ietf-httpbis-http2-09](http://tools.ietf.org/html/draft-ietf-httpbis-http2-9))
+An HTTP/2 ([draft-ietf-httpbis-http2-10](http://tools.ietf.org/html/draft-ietf-httpbis-http2-10))
 client and server implementation for node.js.
 
 Installation
 ------------
 
 ```
 npm install http2
 ```
@@ -97,19 +97,19 @@ Used libraries:
 * [istanbul](https://github.com/gotwarlost/istanbul) for code coverage analysis
 * [docco](http://jashkenas.github.io/docco/) for developer documentation
 * [bunyan](https://github.com/trentm/node-bunyan) for logging
 
 For pretty printing logs, you will also need a global install of bunyan (`npm install -g bunyan`).
 
 ### Developer documentation ###
 
-The developer documentation is located in the `doc` directory. The docs are usually updated only
-before releasing a new version. To regenerate them manually, run `npm run-script prepublish`.
-There's a hosted version which is located [here](http://molnarg.github.io/node-http2/doc/).
+The developer documentation is generated from the source code using docco and can be viewed online
+[here](http://molnarg.github.io/node-http2/doc/). If you'd like to have an offline copy, just run
+`npm run-script doc`.
 
 ### Running the tests ###
 
 It's easy, just run `npm test`. The tests are written in BDD style, so they are a good starting
 point to understand the code.
 
 ### Test coverage ###
 
deleted file mode 100644
--- a/testing/xpcshell/node-http2/doc/docco.css
+++ /dev/null
@@ -1,511 +0,0 @@
-/*-------------- node-http2 customizations --------------------*/
-
-ul.sections > li > div.annotation {
-    min-width: 35em !important;
-    max-width: 35em !important;
-}
-
-#background {
-    width: 35em !important;
-}
-
-/*--------------------- Typography ----------------------------*/
-
-@font-face {
-    font-family: 'aller-light';
-    src: url('public/fonts/aller-light.eot');
-    src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'),
-         url('public/fonts/aller-light.woff') format('woff'),
-         url('public/fonts/aller-light.ttf') format('truetype');
-    font-weight: normal;
-    font-style: normal;
-}
-
-@font-face {
-    font-family: 'aller-bold';
-    src: url('public/fonts/aller-bold.eot');
-    src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'),
-         url('public/fonts/aller-bold.woff') format('woff'),
-         url('public/fonts/aller-bold.ttf') format('truetype');
-    font-weight: normal;
-    font-style: normal;
-}
-
-@font-face {
-    font-family: 'novecento-bold';
-    src: url('public/fonts/novecento-bold.eot');
-    src: url('public/fonts/novecento-bold.eot?#iefix') format('embedded-opentype'),
-         url('public/fonts/novecento-bold.woff') format('woff'),
-         url('public/fonts/novecento-bold.ttf') format('truetype');
-    font-weight: normal;
-    font-style: normal;
-}
-
-/*--------------------- Layout ----------------------------*/
-html { height: 100%; }
-body {
-  font-family: "aller-light";
-  font-size: 14px;
-  line-height: 18px;
-  color: #30404f;
-  margin: 0; padding: 0;
-  height:100%;
-}
-#container { min-height: 100%; }
-
-a {
-  color: #000;
-}
-
-b, strong {
-  font-weight: normal;
-  font-family: "aller-bold";
-}
-
-p, ul, ol {
-  margin: 15px 0 0px;
-}
-
-h1, h2, h3, h4, h5, h6 {
-  color: #112233;
-  line-height: 1em;
-  font-weight: normal;
-  font-family: "novecento-bold";
-  text-transform: uppercase;
-  margin: 30px 0 15px 0;
-}
-
-h1 {
-  margin-top: 40px;
-}
-
-hr {
-  border: 0;
-  background: 1px solid #ddd;
-  height: 1px;
-  margin: 20px 0;
-}
-
-pre, tt, code {
-  font-size: 12px; line-height: 16px;
-  font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
-  margin: 0; padding: 0;
-}
-  .annotation pre {
-    display: block;
-    margin: 0;
-    padding: 7px 10px;
-    background: #fcfcfc;
-    -moz-box-shadow:    inset 0 0 10px rgba(0,0,0,0.1);
-    -webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
-    box-shadow:         inset 0 0 10px rgba(0,0,0,0.1);
-    overflow-x: auto;
-  }
-    .annotation pre code {
-      border: 0;
-      padding: 0;
-      background: transparent;
-    }
-
-
-blockquote {
-  border-left: 5px solid #ccc;
-  margin: 0;
-  padding: 1px 0 1px 1em;
-}
-  .sections blockquote p {
-    font-family: Menlo, Consolas, Monaco, monospace;
-    font-size: 12px; line-height: 16px;
-    color: #999;
-    margin: 10px 0 0;
-    white-space: pre-wrap;
-  }
-
-ul.sections {
-  list-style: none;
-  padding:0 0 5px 0;;
-  margin:0;
-}
-
-/*
-  Force border-box so that % widths fit the parent
-  container without overlap because of margin/padding.
-
-  More Info : http://www.quirksmode.org/css/box.html
-*/
-ul.sections > li > div {
-  -moz-box-sizing: border-box;    /* firefox */
-  -ms-box-sizing: border-box;     /* ie */
-  -webkit-box-sizing: border-box; /* webkit */
-  -khtml-box-sizing: border-box;  /* konqueror */
-  box-sizing: border-box;         /* css3 */
-}
-
-
-/*---------------------- Jump Page -----------------------------*/
-#jump_to, #jump_page {
-  margin: 0;
-  background: white;
-  -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
-  -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
-  font: 16px Arial;
-  cursor: pointer;
-  text-align: right;
-  list-style: none;
-}
-
-#jump_to a {
-  text-decoration: none;
-}
-
-#jump_to a.large {
-  display: none;
-}
-#jump_to a.small {
-  font-size: 22px;
-  font-weight: bold;
-  color: #676767;
-}
-
-#jump_to, #jump_wrapper {
-  position: fixed;
-  right: 0; top: 0;
-  padding: 10px 15px;
-  margin:0;
-}
-
-#jump_wrapper {
-  display: none;
-  padding:0;
-}
-
-#jump_to:hover #jump_wrapper {
-  display: block;
-}
-
-#jump_page {
-  padding: 5px 0 3px;
-  margin: 0 0 25px 25px;
-}
-
-#jump_page .source {
-  display: block;
-  padding: 15px;
-  text-decoration: none;
-  border-top: 1px solid #eee;
-}
-
-#jump_page .source:hover {
-  background: #f5f5ff;
-}
-
-#jump_page .source:first-child {
-}
-
-/*---------------------- Low resolutions (> 320px) ---------------------*/
-@media only screen and (min-width: 320px) {
-  .pilwrap { display: none; }
-
-  ul.sections > li > div {
-    display: block;
-    padding:5px 10px 0 10px;
-  }
-
-  ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
-    padding-left: 30px;
-  }
-
-  ul.sections > li > div.content {
-    background: #f5f5ff;
-    overflow-x:auto;
-    -webkit-box-shadow: inset 0 0 5px #e5e5ee;
-    box-shadow: inset 0 0 5px #e5e5ee;
-    border: 1px solid #dedede;
-    margin:5px 10px 5px 10px;
-    padding-bottom: 5px;
-  }
-
-  ul.sections > li > div.annotation pre {
-    margin: 7px 0 7px;
-    padding-left: 15px;
-  }
-
-  ul.sections > li > div.annotation p tt, .annotation code {
-    background: #f8f8ff;
-    border: 1px solid #dedede;
-    font-size: 12px;
-    padding: 0 0.2em;
-  }
-}
-
-/*----------------------  (> 481px) ---------------------*/
-@media only screen and (min-width: 481px) {
-  #container {
-    position: relative;
-  }
-  body {
-    background-color: #F5F5FF;
-    font-size: 15px;
-    line-height: 21px;
-  }
-  pre, tt, code {
-    line-height: 18px;
-  }
-  p, ul, ol {
-    margin: 0 0 15px;
-  }
-
-
-  #jump_to {
-    padding: 5px 10px;
-  }
-  #jump_wrapper {
-    padding: 0;
-  }
-  #jump_to, #jump_page {
-    font: 10px Arial;
-    text-transform: uppercase;
-  }
-  #jump_page .source {
-    padding: 5px 10px;
-  }
-  #jump_to a.large {
-    display: inline-block;
-  }
-  #jump_to a.small {
-    display: none;
-  }
-
-
-
-  #background {
-    position: absolute;
-    top: 0; bottom: 0;
-    width: 350px;
-    background: #fff;
-    border-right: 1px solid #e5e5ee;
-    z-index: -1;
-  }
-
-  ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
-    padding-left: 40px;
-  }
-
-  ul.sections > li {
-    white-space: nowrap;
-  }
-
-  ul.sections > li > div {
-    display: inline-block;
-  }
-
-  ul.sections > li > div.annotation {
-    max-width: 350px;
-    min-width: 350px;
-    min-height: 5px;
-    padding: 13px;
-    overflow-x: hidden;
-    white-space: normal;
-    vertical-align: top;
-    text-align: left;
-  }
-  ul.sections > li > div.annotation pre {
-    margin: 15px 0 15px;
-    padding-left: 15px;
-  }
-
-  ul.sections > li > div.content {
-    padding: 13px;
-    vertical-align: top;
-    background: #f5f5ff;
-    border: none;
-    -webkit-box-shadow: none;
-    box-shadow: none;
-  }
-
-  .pilwrap {
-    position: relative;
-    display: inline;
-  }
-
-  .pilcrow {
-    font: 12px Arial;
-    text-decoration: none;
-    color: #454545;
-    position: absolute;
-    top: 3px; left: -20px;
-    padding: 1px 2px;
-    opacity: 0;
-    -webkit-transition: opacity 0.2s linear;
-  }
-    .for-h1 .pilcrow {
-      top: 47px;
-    }
-    .for-h2 .pilcrow, .for-h3 .pilcrow, .for-h4 .pilcrow {
-      top: 35px;
-    }
-
-  ul.sections > li > div.annotation:hover .pilcrow {
-    opacity: 1;
-  }
-}
-
-/*---------------------- (> 1025px) ---------------------*/
-@media only screen and (min-width: 1025px) {
-
-  body {
-    font-size: 16px;
-    line-height: 24px;
-  }
-
-  #background {
-    width: 525px;
-  }
-  ul.sections > li > div.annotation {
-    max-width: 525px;
-    min-width: 525px;
-    padding: 10px 25px 1px 50px;
-  }
-  ul.sections > li > div.content {
-    padding: 9px 15px 16px 25px;
-  }
-}
-
-/*---------------------- Syntax Highlighting -----------------------------*/
-
-td.linenos { background-color: #f0f0f0; padding-right: 10px; }
-span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
-/*
-
-github.com style (c) Vasily Polovnyov <vast@whiteants.net>
-
-*/
-
-pre code {
-  display: block; padding: 0.5em;
-  color: #000;
-  background: #f8f8ff
-}
-
-pre .comment,
-pre .template_comment,
-pre .diff .header,
-pre .javadoc {
-  color: #408080;
-  font-style: italic
-}
-
-pre .keyword,
-pre .assignment,
-pre .literal,
-pre .css .rule .keyword,
-pre .winutils,
-pre .javascript .title,
-pre .lisp .title,
-pre .subst {
-  color: #954121;
-  /*font-weight: bold*/
-}
-
-pre .number,
-pre .hexcolor {
-  color: #40a070
-}
-
-pre .string,
-pre .tag .value,
-pre .phpdoc,
-pre .tex .formula {
-  color: #219161;
-}
-
-pre .title,
-pre .id {
-  color: #19469D;
-}
-pre .params {
-  color: #00F;
-}
-
-pre .javascript .title,
-pre .lisp .title,
-pre .subst {
-  font-weight: normal
-}
-
-pre .class .title,
-pre .haskell .label,
-pre .tex .command {
-  color: #458;
-  font-weight: bold
-}
-
-pre .tag,
-pre .tag .title,
-pre .rules .property,
-pre .django .tag .keyword {
-  color: #000080;
-  font-weight: normal
-}
-
-pre .attribute,
-pre .variable,
-pre .instancevar,
-pre .lisp .body {
-  color: #008080
-}
-
-pre .regexp {
-  color: #B68
-}
-
-pre .class {
-  color: #458;
-  font-weight: bold
-}
-
-pre .symbol,
-pre .ruby .symbol .string,
-pre .ruby .symbol .keyword,
-pre .ruby .symbol .keymethods,
-pre .lisp .keyword,
-pre .tex .special,
-pre .input_number {
-  color: #990073
-}
-
-pre .builtin,
-pre .constructor,
-pre .built_in,
-pre .lisp .title {
-  color: #0086b3
-}
-
-pre .preprocessor,
-pre .pi,
-pre .doctype,
-pre .shebang,
-pre .cdata {
-  color: #999;
-  font-weight: bold
-}
-
-pre .deletion {
-  background: #fdd
-}
-
-pre .addition {
-  background: #dfd
-}
-
-pre .diff .change {
-  background: #0086b3
-}
-
-pre .chunk {
-  color: #aaa
-}
-
-pre .tex .formula {
-  opacity: 0.5;
-}
deleted file mode 100644
--- a/testing/xpcshell/node-http2/doc/http.html
+++ /dev/null
@@ -1,1868 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-  <title>Public API</title>
-  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
-  <link rel="stylesheet" media="all" href="docco.css" />
-</head>
-<body>
-  <div id="container">
-    <div id="background"></div>
-    
-      <ul id="jump_to">
-        <li>
-          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
-          <a class="small" href="javascript:void(0);">+</a>
-          <div id="jump_wrapper">
-          <div id="jump_page">
-            
-              
-              <a class="source" href="http.html">
-                http.js
-              </a>
-            
-              
-              <a class="source" href="index.html">
-                index.js
-              </a>
-            
-          </div>
-        </li>
-      </ul>
-    
-    <ul class="sections">
-        
-        
-        
-        <li id="section-1">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h1">
-                <a class="pilcrow" href="#section-1">&#182;</a>
-              </div>
-              <h1>Public API</h1>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-2">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-2">&#182;</a>
-              </div>
-              <p>The main governing power behind the http2 API design is that it should look very similar to the
-existing node.js [HTTPS API][1] (which is, in turn, almost identical to the [HTTP API][2]). The
-additional features of HTTP/2 are exposed as extensions to this API. Furthermore, node-http2
-should fall back to using HTTP/1.1 if needed. Compatibility with undocumented or deprecated
-elements of the node.js HTTP/HTTPS API is a non-goal.</p>
-<h2>Additional and modified API elements</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-3">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-3">&#182;</a>
-              </div>
-              <ul>
-<li><p><strong>Class: http2.Endpoint</strong>: an API for using the raw HTTP/2 framing layer. For documentation
-see the <a href="endpoint.html">lib/endpoint.js</a> file.</p>
-</li>
-<li><p><strong>Class: http2.Server</strong></p>
-<ul>
-<li><strong>Event: &#39;connection&#39; (socket, [endpoint])</strong>: there&#39;s a second argument if the negotiation of
-HTTP/2 was successful: the reference to the <a href="endpoint.html">Endpoint</a> object tied to the
-socket.</li>
-</ul>
-</li>
-<li><p><strong>http2.createServer(options, [requestListener])</strong>: additional option:</p>
-<ul>
-<li><strong>log</strong>: an optional <a href="https://github.com/trentm/node-bunyan">bunyan</a> logger object</li>
-<li><strong>plain</strong>: if <code>true</code>, the server will accept HTTP/2 connections over plain TCP instead of
-TLS</li>
-</ul>
-</li>
-<li><p><strong>Class: http2.ServerResponse</strong></p>
-<ul>
-<li><strong>response.push(options)</strong>: initiates a server push. <code>options</code> describes the &#39;imaginary&#39;
-request to which the push stream is a response; the possible options are identical to the
-ones accepted by <code>http2.request</code>. Returns a ServerResponse object that can be used to send
-the response headers and content.</li>
-</ul>
-</li>
-<li><p><strong>Class: http2.Agent</strong></p>
-<ul>
-<li><strong>new Agent(options)</strong>: additional option:<ul>
-<li><strong>log</strong>: an optional <a href="https://github.com/trentm/node-bunyan">bunyan</a> logger object</li>
-</ul>
-</li>
-<li><strong>agent.sockets</strong>: only contains TCP sockets that corresponds to HTTP/1 requests.</li>
-<li><strong>agent.endpoints</strong>: contains <a href="endpoint.html">Endpoint</a> objects for HTTP/2 connections.</li>
-</ul>
-</li>
-<li><p><strong>http2.request(options, [callback])</strong>: additional option:</p>
-<ul>
-<li><strong>plain</strong>: if <code>true</code>, the client will not try to build a TLS tunnel, instead it will use
-the raw TCP stream for HTTP/2</li>
-</ul>
-</li>
-<li><p><strong>Class: http2.ClientRequest</strong></p>
-<ul>
-<li><strong>Event: &#39;socket&#39; (socket)</strong>: in case of an HTTP/2 incoming message, <code>socket</code> is a reference
-to the associated <a href="stream.html">HTTP/2 Stream</a> object (and not to the TCP socket).</li>
-<li><strong>Event: &#39;push&#39; (promise)</strong>: signals the intention of a server push associated to this
-request. <code>promise</code> is an IncomingPromise. If there&#39;s no listener for this event, the server
-push is cancelled.</li>
-<li><strong>request.setPriority(priority)</strong>: assign a priority to this request. <code>priority</code> is a number
-between 0 (highest priority) and 2^31-1 (lowest priority). Default value is 2^30.</li>
-</ul>
-</li>
-<li><p><strong>Class: http2.IncomingMessage</strong></p>
-<ul>
-<li>has two subclasses for easier interface description: <strong>IncomingRequest</strong> and
-<strong>IncomingResponse</strong></li>
-<li><strong>message.socket</strong>: in case of an HTTP/2 incoming message, it&#39;s a reference to the associated
-<a href="stream.html">HTTP/2 Stream</a> object (and not to the TCP socket).</li>
-</ul>
-</li>
-<li><p><strong>Class: http2.IncomingRequest (IncomingMessage)</strong></p>
-<ul>
-<li><strong>message.url</strong>: in case of an HTTP/2 incoming request, the <code>url</code> field always contains the
-path, and never a full url (it contains the path in most cases in the HTTPS api as well).</li>
-<li><strong>message.scheme</strong>: additional field. Mandatory HTTP/2 request metadata.</li>
-<li><strong>message.host</strong>: additional field. Mandatory HTTP/2 request metadata. Note that this
-replaces the old Host header field, but node-http2 will add Host to the <code>message.headers</code> for
-backwards compatibility.</li>
-</ul>
-</li>
-<li><p><strong>Class: http2.IncomingPromise (IncomingRequest)</strong></p>
-<ul>
-<li>contains the metadata of the &#39;imaginary&#39; request to which the server push is an answer.</li>
-<li><strong>Event: &#39;response&#39; (response)</strong>: signals the arrival of the actual push stream. <code>response</code>
-is an IncomingResponse.</li>
-<li><strong>Event: &#39;push&#39; (promise)</strong>: signals the intention of a server push associated to this
-request. <code>promise</code> is an IncomingPromise. If there&#39;s no listener for this event, the server
-push is cancelled.</li>
-<li><strong>promise.cancel()</strong>: cancels the promised server push.</li>
-<li><strong>promise.setPriority(priority)</strong>: assign a priority to this push stream. <code>priority</code> is a
-number between 0 (highest priority) and 2^31-1 (lowest priority). Default value is 2^30.</li>
-</ul>
-</li>
-</ul>
-<h2>API elements not yet implemented</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-4">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-4">&#182;</a>
-              </div>
-              <ul>
-<li><strong>Class: http2.Server</strong><ul>
-<li><strong>server.maxHeadersCount</strong></li>
-</ul>
-</li>
-</ul>
-<h2>API elements that are not applicable to HTTP/2</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-5">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-5">&#182;</a>
-              </div>
-              <p>The reason may be deprecation of certain HTTP/1.1 features, or that some API elements simply
-don&#39;t make sense when using HTTP/2. These will not be present when a request is done with HTTP/2,
-but will function normally when falling back to using HTTP/1.1.</p>
-<ul>
-<li><p><strong>Class: http2.Server</strong></p>
-<ul>
-<li><strong>Event: &#39;checkContinue&#39;</strong>: not in the spec, yet (see <a href="https://github.com/http2/http2-spec/issues/18">http-spec#18</a>)</li>
-<li><strong>Event: &#39;upgrade&#39;</strong>: upgrade is deprecated in HTTP/2</li>
-<li><strong>Event: &#39;timeout&#39;</strong>: HTTP/2 sockets won&#39;t timeout because of application level keepalive
-(PING frames)</li>
-<li><strong>Event: &#39;connect&#39;</strong>: not in the spec, yet (see <a href="https://github.com/http2/http2-spec/issues/230">http-spec#230</a>)</li>
-<li><strong>server.setTimeout(msecs, [callback])</strong></li>
-<li><strong>server.timeout</strong></li>
-</ul>
-</li>
-<li><p><strong>Class: http2.ServerResponse</strong></p>
-<ul>
-<li><strong>Event: &#39;close&#39;</strong></li>
-<li><strong>Event: &#39;timeout&#39;</strong></li>
-<li><strong>response.writeContinue()</strong></li>
-<li><strong>response.writeHead(statusCode, [reasonPhrase], [headers])</strong>: reasonPhrase will always be
-ignored since <a href="http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-8.1.3.2">it&#39;s not supported in HTTP/2</a></li>
-<li><strong>response.setTimeout(timeout, [callback])</strong></li>
-</ul>
-</li>
-<li><p><strong>Class: http2.Agent</strong></p>
-<ul>
-<li><strong>agent.maxSockets</strong>: only affects HTTP/1 connection pool. When using HTTP/2, there&#39;s always
-one connection per host.</li>
-</ul>
-</li>
-<li><p><strong>Class: http2.ClientRequest</strong></p>
-<ul>
-<li><strong>Event: &#39;upgrade&#39;</strong></li>
-<li><strong>Event: &#39;connect&#39;</strong></li>
-<li><strong>Event: &#39;continue&#39;</strong></li>
-<li><strong>request.setTimeout(timeout, [callback])</strong></li>
-<li><strong>request.setNoDelay([noDelay])</strong></li>
-<li><strong>request.setSocketKeepAlive([enable], [initialDelay])</strong></li>
-</ul>
-</li>
-<li><p><strong>Class: http2.IncomingMessage</strong></p>
-<ul>
-<li><strong>Event: &#39;close&#39;</strong></li>
-<li><strong>message.setTimeout(timeout, [callback])</strong></li>
-</ul>
-</li>
-</ul>
-<h1>Common server and client side code</h1>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-6">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-6">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> net = require(<span class="string">'net'</span>);
-<span class="keyword">var</span> url = require(<span class="string">'url'</span>);
-<span class="keyword">var</span> util = require(<span class="string">'util'</span>);
-<span class="keyword">var</span> EventEmitter = require(<span class="string">'events'</span>).EventEmitter;
-<span class="keyword">var</span> PassThrough = require(<span class="string">'stream'</span>).PassThrough;
-<span class="keyword">var</span> Readable = require(<span class="string">'stream'</span>).Readable;
-<span class="keyword">var</span> Writable = require(<span class="string">'stream'</span>).Writable;
-<span class="keyword">var</span> Endpoint = require(<span class="string">'http2-protocol'</span>).Endpoint;
-<span class="keyword">var</span> http = require(<span class="string">'http'</span>);
-<span class="keyword">var</span> https = require(<span class="string">'https'</span>);
-
-exports.STATUS_CODES = http.STATUS_CODES;
-exports.IncomingMessage = IncomingMessage;
-exports.OutgoingMessage = OutgoingMessage;
-
-<span class="keyword">var</span> deprecatedHeaders = [
-  <span class="string">'connection'</span>,
-  <span class="string">'host'</span>,
-  <span class="string">'keep-alive'</span>,
-  <span class="string">'proxy-connection'</span>,
-  <span class="string">'te'</span>,
-  <span class="string">'transfer-encoding'</span>,
-  <span class="string">'upgrade'</span>
-];</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-7">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-7">&#182;</a>
-              </div>
-              <p>The implemented version of the HTTP/2 specification is <a href="http://tools.ietf.org/html/draft-ietf-httpbis-http2-09">draft 09</a>.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> implementedVersion = <span class="string">'HTTP-draft-09/2.0'</span>;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-8">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-8">&#182;</a>
-              </div>
-              <p>When doing NPN/ALPN negotiation, HTTP/1.1 is used as fallback</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> supportedProtocols = [implementedVersion, <span class="string">'http/1.1'</span>, <span class="string">'http/1.0'</span>];</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-9">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h2">
-                <a class="pilcrow" href="#section-9">&#182;</a>
-              </div>
-              <h2>Logging</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-10">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-10">&#182;</a>
-              </div>
-              <p>Logger shim, used when no logger is provided by the user.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">noop</span><span class="params">()</span> {</span>}
-<span class="keyword">var</span> defaultLogger = {
-  fatal: noop,
-  error: noop,
-  warn : noop,
-  info : noop,
-  debug: noop,
-  trace: noop,
-
-  child: <span class="keyword">function</span>() { <span class="keyword">return</span> <span class="keyword">this</span>; }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-11">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-11">&#182;</a>
-              </div>
-              <p>Bunyan serializers exported by submodules that are worth adding when creating a logger.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>exports.serializers = require(<span class="string">'http2-protocol'</span>).serializers;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-12">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h2">
-                <a class="pilcrow" href="#section-12">&#182;</a>
-              </div>
-              <h2>IncomingMessage class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-13">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-13">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">IncomingMessage</span><span class="params">(stream)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-14">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-14">&#182;</a>
-              </div>
-              <ul>
-<li>This is basically a read-only wrapper for the <a href="stream.html">Stream</a> class.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  PassThrough.call(<span class="keyword">this</span>);
-  stream.pipe(<span class="keyword">this</span>);
-  <span class="keyword">this</span>.socket = <span class="keyword">this</span>.stream = stream;
-
-  <span class="keyword">this</span>._log = stream._log.child({ component: <span class="string">'http'</span> });</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-15">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-15">&#182;</a>
-              </div>
-              <ul>
-<li>HTTP/2.0 does not define a way to carry the version identifier that is included in the
-HTTP/1.1 request/status line. Version is always 2.0.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>.httpVersion = <span class="string">'2.0'</span>;
-  <span class="keyword">this</span>.httpVersionMajor = <span class="number">2</span>;
-  <span class="keyword">this</span>.httpVersionMinor = <span class="number">0</span>;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-16">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-16">&#182;</a>
-              </div>
-              <ul>
-<li><code>this.headers</code> will store the regular headers (and none of the special colon headers)</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>.headers = {};
-  <span class="keyword">this</span>.trailers = <span class="literal">undefined</span>;
-  <span class="keyword">this</span>._lastHeadersSeen = <span class="literal">undefined</span>;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-17">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-17">&#182;</a>
-              </div>
-              <ul>
-<li>Other metadata is filled in when the headers arrive.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  stream.once(<span class="string">'headers'</span>, <span class="keyword">this</span>._onHeaders.bind(<span class="keyword">this</span>));
-  stream.once(<span class="string">'end'</span>, <span class="keyword">this</span>._onEnd.bind(<span class="keyword">this</span>));
-}
-IncomingMessage.prototype = Object.create(PassThrough.prototype, { constructor: { value: IncomingMessage } });</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-18">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-18">&#182;</a>
-              </div>
-              <p><a href="http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-8.1.3.1">Request Header Fields</a>
-* <code>headers</code> argument: HTTP/2.0 request and response header fields carry information as a series
-  of key-value pairs. This includes the target URI for the request, the status code for the
-  response, as well as HTTP header fields.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>IncomingMessage.prototype._onHeaders = <span class="function"><span class="keyword">function</span> <span class="title">_onHeaders</span><span class="params">(headers)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-19">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-19">&#182;</a>
-              </div>
-              <ul>
-<li>An HTTP/2.0 request or response MUST NOT include any of the following header fields:
-Connection, Host, Keep-Alive, Proxy-Connection, TE, Transfer-Encoding, and Upgrade. A server
-MUST treat the presence of any of these header fields as a stream error of type
-PROTOCOL_ERROR.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; deprecatedHeaders.length; i++) {
-    <span class="keyword">var</span> key = deprecatedHeaders[i];
-    <span class="keyword">if</span> (key <span class="keyword">in</span> headers) {
-      <span class="keyword">this</span>._log.error({ key: key, value: headers[key] }, <span class="string">'Deprecated header found'</span>);
-      <span class="keyword">this</span>.stream.emit(<span class="string">'error'</span>, <span class="string">'PROTOCOL_ERROR'</span>);
-      <span class="keyword">return</span>;
-    }
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-20">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-20">&#182;</a>
-              </div>
-              <ul>
-<li>Store the <em>regular</em> headers in <code>this.headers</code></li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">for</span> (<span class="keyword">var</span> name <span class="keyword">in</span> headers) {
-    <span class="keyword">if</span> (name[<span class="number">0</span>] !== <span class="string">':'</span>) {
-      <span class="keyword">this</span>.headers[name] = headers[name];
-    }
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-21">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-21">&#182;</a>
-              </div>
-              <ul>
-<li>The last header block, if it&#39;s not the first, will represent the trailers</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">var</span> self = <span class="keyword">this</span>;
-  <span class="keyword">this</span>.stream.on(<span class="string">'headers'</span>, <span class="keyword">function</span>(headers) {
-    self._lastHeadersSeen = headers;
-  });
-};
-
-IncomingMessage.prototype._onEnd = <span class="function"><span class="keyword">function</span> <span class="title">_onEnd</span><span class="params">()</span> {</span>
-  <span class="keyword">this</span>.trailers = <span class="keyword">this</span>._lastHeadersSeen;
-};
-
-IncomingMessage.prototype.setTimeout = noop;
-
-IncomingMessage.prototype._checkSpecialHeader = <span class="function"><span class="keyword">function</span> <span class="title">_checkSpecialHeader</span><span class="params">(key, value)</span> {</span>
-  <span class="keyword">if</span> ((<span class="keyword">typeof</span> value !== <span class="string">'string'</span>) || (value.length === <span class="number">0</span>)) {
-    <span class="keyword">this</span>._log.error({ key: key, value: value }, <span class="string">'Invalid or missing special header field'</span>);
-    <span class="keyword">this</span>.stream.emit(<span class="string">'error'</span>, <span class="string">'PROTOCOL_ERROR'</span>);
-  }
-
-  <span class="keyword">return</span> value;
-}
-;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-22">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h2">
-                <a class="pilcrow" href="#section-22">&#182;</a>
-              </div>
-              <h2>OutgoingMessage class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-23">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-23">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">OutgoingMessage</span><span class="params">()</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-24">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-24">&#182;</a>
-              </div>
-              <ul>
-<li>This is basically a read-only wrapper for the <a href="stream.html">Stream</a> class.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  Writable.call(<span class="keyword">this</span>);
-
-  <span class="keyword">this</span>._headers = {};
-  <span class="keyword">this</span>._trailers = <span class="literal">undefined</span>;
-  <span class="keyword">this</span>.headersSent = <span class="literal">false</span>;
-
-  <span class="keyword">this</span>.on(<span class="string">'finish'</span>, <span class="keyword">this</span>._finish);
-}
-OutgoingMessage.prototype = Object.create(Writable.prototype, { constructor: { value: OutgoingMessage } });
-
-OutgoingMessage.prototype._write = <span class="function"><span class="keyword">function</span> <span class="title">_write</span><span class="params">(chunk, encoding, callback)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.stream) {
-    <span class="keyword">this</span>.stream.write(chunk, encoding, callback);
-  } <span class="keyword">else</span> {
-    <span class="keyword">this</span>.once(<span class="string">'socket'</span>, <span class="keyword">this</span>._write.bind(<span class="keyword">this</span>, chunk, encoding, callback));
-  }
-};
-
-OutgoingMessage.prototype._finish = <span class="function"><span class="keyword">function</span> <span class="title">_finish</span><span class="params">()</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.stream) {
-    <span class="keyword">if</span> (<span class="keyword">this</span>._trailers) {
-      <span class="keyword">if</span> (<span class="keyword">this</span>.request) {
-        <span class="keyword">this</span>.request.addTrailers(<span class="keyword">this</span>._trailers);
-      } <span class="keyword">else</span> {
-        <span class="keyword">this</span>.stream.headers(<span class="keyword">this</span>._trailers);
-      }
-    }
-    <span class="keyword">this</span>.stream.end();
-  } <span class="keyword">else</span> {
-    <span class="keyword">this</span>.once(<span class="string">'socket'</span>, <span class="keyword">this</span>._finish.bind(<span class="keyword">this</span>));
-  }
-};
-
-OutgoingMessage.prototype.setHeader = <span class="function"><span class="keyword">function</span> <span class="title">setHeader</span><span class="params">(name, value)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.headersSent) {
-    <span class="keyword">throw</span> <span class="keyword">new</span> Error(<span class="string">'Can\'t set headers after they are sent.'</span>);
-  } <span class="keyword">else</span> {
-    name = name.toLowerCase();
-    <span class="keyword">if</span> (deprecatedHeaders.indexOf(name) !== -<span class="number">1</span>) {
-      <span class="keyword">throw</span> <span class="keyword">new</span> Error(<span class="string">'Cannot set deprecated header: '</span> + name);
-    }
-    <span class="keyword">this</span>._headers[name] = value;
-  }
-};
-
-OutgoingMessage.prototype.removeHeader = <span class="function"><span class="keyword">function</span> <span class="title">removeHeader</span><span class="params">(name)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.headersSent) {
-    <span class="keyword">throw</span> <span class="keyword">new</span> Error(<span class="string">'Can\'t remove headers after they are sent.'</span>);
-  } <span class="keyword">else</span> {
-    <span class="keyword">delete</span> <span class="keyword">this</span>._headers[name.toLowerCase()];
-  }
-};
-
-OutgoingMessage.prototype.getHeader = <span class="function"><span class="keyword">function</span> <span class="title">getHeader</span><span class="params">(name)</span> {</span>
-  <span class="keyword">return</span> <span class="keyword">this</span>._headers[name.toLowerCase()];
-};
-
-OutgoingMessage.prototype.addTrailers = <span class="function"><span class="keyword">function</span> <span class="title">addTrailers</span><span class="params">(trailers)</span> {</span>
-  <span class="keyword">this</span>._trailers = trailers;
-};
-
-OutgoingMessage.prototype.setTimeout = noop;
-
-OutgoingMessage.prototype._checkSpecialHeader = IncomingMessage.prototype._checkSpecialHeader;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-25">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h1">
-                <a class="pilcrow" href="#section-25">&#182;</a>
-              </div>
-              <h1>Server side</h1>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-26">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-26">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>exports.createServer = createServer;
-exports.Server = Server;
-exports.IncomingRequest = IncomingRequest;
-exports.OutgoingResponse = OutgoingResponse;
-exports.ServerResponse = OutgoingResponse; <span class="comment">// for API compatibility</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-27">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h2">
-                <a class="pilcrow" href="#section-27">&#182;</a>
-              </div>
-              <h2>Server class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-28">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-28">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">Server</span><span class="params">(options)</span> {</span>
-  options = util._extend({}, options);
-
-  <span class="keyword">this</span>._log = (options.log || defaultLogger).child({ component: <span class="string">'http'</span> });
-  <span class="keyword">this</span>._settings = options.settings;
-
-  <span class="keyword">var</span> start = <span class="keyword">this</span>._start.bind(<span class="keyword">this</span>);
-  <span class="keyword">var</span> fallback = <span class="keyword">this</span>._fallback.bind(<span class="keyword">this</span>);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-29">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-29">&#182;</a>
-              </div>
-              <p>HTTP2 over TLS (using NPN or ALPN)</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> ((options.key &amp;&amp; options.cert) || options.pfx) {
-    <span class="keyword">this</span>._log.info(<span class="string">'Creating HTTP/2 server over TLS'</span>);
-    <span class="keyword">this</span>._mode = <span class="string">'tls'</span>;
-    options.ALPNProtocols = supportedProtocols;
-    options.NPNProtocols = supportedProtocols;
-    <span class="keyword">this</span>._server = https.createServer(options);
-    <span class="keyword">this</span>._originalSocketListeners = <span class="keyword">this</span>._server.listeners(<span class="string">'secureConnection'</span>);
-    <span class="keyword">this</span>._server.removeAllListeners(<span class="string">'secureConnection'</span>);
-    <span class="keyword">this</span>._server.on(<span class="string">'secureConnection'</span>, <span class="keyword">function</span>(socket) {
-      <span class="keyword">var</span> negotiatedProtocol = socket.alpnProtocol || socket.npnProtocol;
-      <span class="keyword">if</span> ((negotiatedProtocol === implementedVersion) &amp;&amp; socket.servername) {
-        start(socket);
-      } <span class="keyword">else</span> {
-        fallback(socket);
-      }
-    });
-    <span class="keyword">this</span>._server.on(<span class="string">'request'</span>, <span class="keyword">this</span>.emit.bind(<span class="keyword">this</span>, <span class="string">'request'</span>));
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-30">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-30">&#182;</a>
-              </div>
-              <p>HTTP2 over plain TCP</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> <span class="keyword">if</span> (options.plain) {
-    <span class="keyword">this</span>._log.info(<span class="string">'Creating HTTP/2 server over plain TCP'</span>);
-    <span class="keyword">this</span>._mode = <span class="string">'plain'</span>;
-    <span class="keyword">this</span>._server = net.createServer(start);
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-31">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-31">&#182;</a>
-              </div>
-              <p>HTTP/2 with HTTP/1.1 upgrade</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> {
-    <span class="keyword">this</span>._log.error(<span class="string">'Trying to create HTTP/2 server with Upgrade from HTTP/1.1'</span>);
-    <span class="keyword">throw</span> <span class="keyword">new</span> Error(<span class="string">'HTTP1.1 -&gt; HTTP2 upgrade is not yet supported. Please provide TLS keys.'</span>);
-  }
-
-  <span class="keyword">this</span>._server.on(<span class="string">'close'</span>, <span class="keyword">this</span>.emit.bind(<span class="keyword">this</span>, <span class="string">'close'</span>));
-}
-Server.prototype = Object.create(EventEmitter.prototype, { constructor: { value: Server } });</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-32">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-32">&#182;</a>
-              </div>
-              <p>Starting HTTP/2</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Server.prototype._start = <span class="function"><span class="keyword">function</span> <span class="title">_start</span><span class="params">(socket)</span> {</span>
-  <span class="keyword">var</span> endpoint = <span class="keyword">new</span> Endpoint(<span class="keyword">this</span>._log, <span class="string">'SERVER'</span>, <span class="keyword">this</span>._settings);
-
-  <span class="keyword">this</span>._log.info({ e: endpoint,
-                   client: socket.remoteAddress + <span class="string">':'</span> + socket.remotePort,
-                   SNI: socket.servername
-                 }, <span class="string">'New incoming HTTP/2 connection'</span>);
-
-  endpoint.pipe(socket).pipe(endpoint);
-
-  <span class="keyword">var</span> self = <span class="keyword">this</span>;
-  endpoint.on(<span class="string">'stream'</span>, <span class="function"><span class="keyword">function</span> <span class="title">_onStream</span><span class="params">(stream)</span> {</span>
-    <span class="keyword">var</span> response = <span class="keyword">new</span> OutgoingResponse(stream);
-    <span class="keyword">var</span> request = <span class="keyword">new</span> IncomingRequest(stream);
-
-    request.once(<span class="string">'ready'</span>, self.emit.bind(self, <span class="string">'request'</span>, request, response));
-  });
-
-  endpoint.on(<span class="string">'error'</span>, <span class="keyword">this</span>.emit.bind(<span class="keyword">this</span>, <span class="string">'clientError'</span>));
-  socket.on(<span class="string">'error'</span>, <span class="keyword">this</span>.emit.bind(<span class="keyword">this</span>, <span class="string">'clientError'</span>));
-
-  <span class="keyword">this</span>.emit(<span class="string">'connection'</span>, socket, endpoint);
-};
-
-Server.prototype._fallback = <span class="function"><span class="keyword">function</span> <span class="title">_fallback</span><span class="params">(socket)</span> {</span>
-  <span class="keyword">var</span> negotiatedProtocol = socket.alpnProtocol || socket.npnProtocol;
-
-  <span class="keyword">this</span>._log.info({ client: socket.remoteAddress + <span class="string">':'</span> + socket.remotePort,
-                   protocol: negotiatedProtocol,
-                   SNI: socket.servername
-                 }, <span class="string">'Falling back to simple HTTPS'</span>);
-
-  <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; <span class="keyword">this</span>._originalSocketListeners.length; i++) {
-    <span class="keyword">this</span>._originalSocketListeners[i].call(<span class="keyword">this</span>._server, socket);
-  }
-
-  <span class="keyword">this</span>.emit(<span class="string">'connection'</span>, socket);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-33">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-33">&#182;</a>
-              </div>
-              <p>There are <a href="http://nodejs.org/api/http.html#http_server_listen_port_hostname_backlog_callback">3 possible signatures</a> of the <code>listen</code> function. Every arguments is forwarded to
-the backing TCP or HTTPS server.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Server.prototype.listen = <span class="function"><span class="keyword">function</span> <span class="title">listen</span><span class="params">(port, hostname)</span> {</span>
-  <span class="keyword">this</span>._log.info({ on: ((<span class="keyword">typeof</span> hostname === <span class="string">'string'</span>) ? (hostname + <span class="string">':'</span> + port) : port) },
-                 <span class="string">'Listening for incoming connections'</span>);
-  <span class="keyword">this</span>._server.listen.apply(<span class="keyword">this</span>._server, arguments);
-};
-
-Server.prototype.close = <span class="function"><span class="keyword">function</span> <span class="title">close</span><span class="params">(callback)</span> {</span>
-  <span class="keyword">this</span>._log.info(<span class="string">'Closing server'</span>);
-  <span class="keyword">this</span>._server.close(callback);
-};
-
-Server.prototype.setTimeout = <span class="function"><span class="keyword">function</span> <span class="title">setTimeout</span><span class="params">(timeout, callback)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>._mode === <span class="string">'tls'</span>) {
-    <span class="keyword">this</span>._server.setTimeout(timeout, callback);
-  }
-};
-
-Object.defineProperty(Server.prototype, <span class="string">'timeout'</span>, {
-  get: <span class="function"><span class="keyword">function</span> <span class="title">getTimeout</span><span class="params">()</span> {</span>
-    <span class="keyword">if</span> (<span class="keyword">this</span>._mode === <span class="string">'tls'</span>) {
-      <span class="keyword">return</span> <span class="keyword">this</span>._server.timeout;
-    } <span class="keyword">else</span> {
-      <span class="keyword">return</span> <span class="literal">undefined</span>;
-    }
-  },
-  set: <span class="function"><span class="keyword">function</span> <span class="title">setTimeout</span><span class="params">(timeout)</span> {</span>
-    <span class="keyword">if</span> (<span class="keyword">this</span>._mode === <span class="string">'tls'</span>) {
-      <span class="keyword">this</span>._server.timeout = timeout;
-    }
-  }
-});</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-34">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-34">&#182;</a>
-              </div>
-              <p>Overriding <code>EventEmitter</code>&#39;s <code>on(event, listener)</code> method to forward certain subscriptions to
-<code>server</code>.There are events on the <code>http.Server</code> class where it makes difference whether someone is
-listening on the event or not. In these cases, we can not simply forward the events from the
-<code>server</code> to <code>this</code> since that means a listener. Instead, we forward the subscriptions.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Server.prototype.on = <span class="function"><span class="keyword">function</span> <span class="title">on</span><span class="params">(event, listener)</span> {</span>
-  <span class="keyword">if</span> ((event === <span class="string">'upgrade'</span>) || (event === <span class="string">'timeout'</span>)) {
-    <span class="keyword">this</span>._server.on(event, listener &amp;&amp; listener.bind(<span class="keyword">this</span>));
-  } <span class="keyword">else</span> {
-    EventEmitter.prototype.on.call(<span class="keyword">this</span>, event, listener);
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-35">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-35">&#182;</a>
-              </div>
-              <p><code>addContext</code> is used to add Server Name Indication contexts</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Server.prototype.addContext = <span class="function"><span class="keyword">function</span> <span class="title">addContext</span><span class="params">(hostname, credentials)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>._mode === <span class="string">'tls'</span>) {
-    <span class="keyword">this</span>._server.addContext(hostname, credentials);
-  }
-};
-
-<span class="function"><span class="keyword">function</span> <span class="title">createServer</span><span class="params">(options, requestListener)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">typeof</span> options === <span class="string">'function'</span>) {
-    requestListener = options;
-    options = <span class="literal">undefined</span>;
-  }
-
-  <span class="keyword">var</span> server = <span class="keyword">new</span> Server(options);
-
-  <span class="keyword">if</span> (requestListener) {
-    server.on(<span class="string">'request'</span>, requestListener);
-  }
-
-  <span class="keyword">return</span> server;
-}</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-36">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h2">
-                <a class="pilcrow" href="#section-36">&#182;</a>
-              </div>
-              <h2>IncomingRequest class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-37">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-37">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">IncomingRequest</span><span class="params">(stream)</span> {</span>
-  IncomingMessage.call(<span class="keyword">this</span>, stream);
-}
-IncomingRequest.prototype = Object.create(IncomingMessage.prototype, { constructor: { value: IncomingRequest } });</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-38">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-38">&#182;</a>
-              </div>
-              <p><a href="http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-8.1.3.1">Request Header Fields</a>
-* <code>headers</code> argument: HTTP/2.0 request and response header fields carry information as a series
-  of key-value pairs. This includes the target URI for the request, the status code for the
-  response, as well as HTTP header fields.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>IncomingRequest.prototype._onHeaders = <span class="function"><span class="keyword">function</span> <span class="title">_onHeaders</span><span class="params">(headers)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-39">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-39">&#182;</a>
-              </div>
-              <ul>
-<li>The &quot;:method&quot; header field includes the HTTP method</li>
-<li>The &quot;:scheme&quot; header field includes the scheme portion of the target URI</li>
-<li>The &quot;:authority&quot; header field includes the authority portion of the target URI</li>
-<li>The &quot;:path&quot; header field includes the path and query parts of the target URI.
-This field MUST NOT be empty; URIs that do not contain a path component MUST include a value
-of &#39;/&#39;, unless the request is an OPTIONS request for &#39;<em>&#39;, in which case the &quot;:path&quot; header
-field MUST include &#39;</em>&#39;.</li>
-<li>All HTTP/2.0 requests MUST include exactly one valid value for all of these header fields. A
-server MUST treat the absence of any of these header fields, presence of multiple values, or
-an invalid value as a stream error of type PROTOCOL_ERROR.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>.method = <span class="keyword">this</span>._checkSpecialHeader(<span class="string">':method'</span>   , headers[<span class="string">':method'</span>]);
-  <span class="keyword">this</span>.scheme = <span class="keyword">this</span>._checkSpecialHeader(<span class="string">':scheme'</span>   , headers[<span class="string">':scheme'</span>]);
-  <span class="keyword">this</span>.host   = <span class="keyword">this</span>._checkSpecialHeader(<span class="string">':authority'</span>, headers[<span class="string">':authority'</span>]  );
-  <span class="keyword">this</span>.url    = <span class="keyword">this</span>._checkSpecialHeader(<span class="string">':path'</span>     , headers[<span class="string">':path'</span>]  );</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-40">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-40">&#182;</a>
-              </div>
-              <ul>
-<li>Host header is included in the headers object for backwards compatibility.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>.headers.host = <span class="keyword">this</span>.host;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-41">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-41">&#182;</a>
-              </div>
-              <ul>
-<li>Handling regular headers.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  IncomingMessage.prototype._onHeaders.call(<span class="keyword">this</span>, headers);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-42">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-42">&#182;</a>
-              </div>
-              <ul>
-<li>Signaling that the headers arrived.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._log.info({ method: <span class="keyword">this</span>.method, scheme: <span class="keyword">this</span>.scheme, host: <span class="keyword">this</span>.host,
-                   path: <span class="keyword">this</span>.url, headers: <span class="keyword">this</span>.headers }, <span class="string">'Incoming request'</span>);
-  <span class="keyword">this</span>.emit(<span class="string">'ready'</span>);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-43">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h2">
-                <a class="pilcrow" href="#section-43">&#182;</a>
-              </div>
-              <h2>OutgoingResponse class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-44">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-44">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">OutgoingResponse</span><span class="params">(stream)</span> {</span>
-  OutgoingMessage.call(<span class="keyword">this</span>);
-
-  <span class="keyword">this</span>._log = stream._log.child({ component: <span class="string">'http'</span> });
-
-  <span class="keyword">this</span>.stream = stream;
-  <span class="keyword">this</span>.statusCode = <span class="number">200</span>;
-  <span class="keyword">this</span>.sendDate = <span class="literal">true</span>;
-
-  <span class="keyword">this</span>.stream.once(<span class="string">'headers'</span>, <span class="keyword">this</span>._onRequestHeaders.bind(<span class="keyword">this</span>));
-}
-OutgoingResponse.prototype = Object.create(OutgoingMessage.prototype, { constructor: { value: OutgoingResponse } });
-
-OutgoingResponse.prototype.writeHead = <span class="function"><span class="keyword">function</span> <span class="title">writeHead</span><span class="params">(statusCode, reasonPhrase, headers)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">typeof</span> reasonPhrase === <span class="string">'string'</span>) {
-    <span class="keyword">this</span>._log.warn(<span class="string">'Reason phrase argument was present but ignored by the writeHead method'</span>);
-  } <span class="keyword">else</span> {
-    headers = reasonPhrase;
-  }
-
-  <span class="keyword">for</span> (<span class="keyword">var</span> name <span class="keyword">in</span> headers) {
-    <span class="keyword">this</span>.setHeader(name, headers[name]);
-  }
-  headers = <span class="keyword">this</span>._headers;
-
-  <span class="keyword">if</span> (<span class="keyword">this</span>.sendDate &amp;&amp; !(<span class="string">'date'</span> <span class="keyword">in</span> <span class="keyword">this</span>._headers)) {
-    headers.date = (<span class="keyword">new</span> Date()).toUTCString();
-  }
-
-  <span class="keyword">this</span>._log.info({ status: statusCode, headers: <span class="keyword">this</span>._headers }, <span class="string">'Sending server response'</span>);
-
-  headers[<span class="string">':status'</span>] = <span class="keyword">this</span>.statusCode = statusCode;
-
-  <span class="keyword">this</span>.stream.headers(headers);
-  <span class="keyword">this</span>.headersSent = <span class="literal">true</span>;
-};
-
-OutgoingResponse.prototype._implicitHeaders = <span class="function"><span class="keyword">function</span> <span class="title">_implicitHeaders</span><span class="params">()</span> {</span>
-  <span class="keyword">if</span> (!<span class="keyword">this</span>.headersSent) {
-    <span class="keyword">this</span>.writeHead(<span class="keyword">this</span>.statusCode);
-  }
-};
-
-OutgoingResponse.prototype.write = <span class="function"><span class="keyword">function</span> <span class="title">write</span><span class="params">()</span> {</span>
-  <span class="keyword">this</span>._implicitHeaders();
-  <span class="keyword">return</span> OutgoingMessage.prototype.write.apply(<span class="keyword">this</span>, arguments);
-};
-
-OutgoingResponse.prototype.end = <span class="function"><span class="keyword">function</span> <span class="title">end</span><span class="params">()</span> {</span>
-  <span class="keyword">this</span>._implicitHeaders();
-  <span class="keyword">return</span> OutgoingMessage.prototype.end.apply(<span class="keyword">this</span>, arguments);
-};
-
-OutgoingResponse.prototype._onRequestHeaders = <span class="function"><span class="keyword">function</span> <span class="title">_onRequestHeaders</span><span class="params">(headers)</span> {</span>
-  <span class="keyword">this</span>._requestHeaders = headers;
-};
-
-OutgoingResponse.prototype.push = <span class="function"><span class="keyword">function</span> <span class="title">push</span><span class="params">(options)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">typeof</span> options === <span class="string">'string'</span>) {
-    options = url.parse(options);
-  }
-
-  <span class="keyword">if</span> (!options.path) {
-    <span class="keyword">throw</span> <span class="keyword">new</span> Error(<span class="string">'`path` option is mandatory.'</span>);
-  }
-
-  <span class="keyword">var</span> promise = util._extend({
-    <span class="string">':method'</span>: (options.method || <span class="string">'GET'</span>).toUpperCase(),
-    <span class="string">':scheme'</span>: (options.protocol &amp;&amp; options.protocol.slice(<span class="number">0</span>, -<span class="number">1</span>)) || <span class="keyword">this</span>._requestHeaders[<span class="string">':scheme'</span>],
-    <span class="string">':authority'</span>: options.hostname || options.host || <span class="keyword">this</span>._requestHeaders[<span class="string">':authority'</span>],
-    <span class="string">':path'</span>: options.path
-  }, options.headers);
-
-  <span class="keyword">this</span>._log.info({ method: promise[<span class="string">':method'</span>], scheme: promise[<span class="string">':scheme'</span>],
-                   authority: promise[<span class="string">':authority'</span>], path: promise[<span class="string">':path'</span>],
-                   headers: options.headers }, <span class="string">'Promising push stream'</span>);
-
-  <span class="keyword">var</span> pushStream = <span class="keyword">this</span>.stream.promise(promise);
-
-  <span class="keyword">return</span> <span class="keyword">new</span> OutgoingResponse(pushStream);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-45">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-45">&#182;</a>
-              </div>
-              <p>Overriding <code>EventEmitter</code>&#39;s <code>on(event, listener)</code> method to forward certain subscriptions to
-<code>request</code>. See <code>Server.prototype.on</code> for explanation.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>OutgoingResponse.prototype.on = <span class="function"><span class="keyword">function</span> <span class="title">on</span><span class="params">(event, listener)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.request &amp;&amp; (event === <span class="string">'timeout'</span>)) {
-    <span class="keyword">this</span>.request.on(event, listener &amp;&amp; listener.bind(<span class="keyword">this</span>));
-  } <span class="keyword">else</span> {
-    OutgoingMessage.prototype.on.call(<span class="keyword">this</span>, event, listener);
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-46">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h1">
-                <a class="pilcrow" href="#section-46">&#182;</a>
-              </div>
-              <h1>Client side</h1>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-47">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-47">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>exports.ClientRequest = OutgoingRequest; <span class="comment">// for API compatibility</span>
-exports.OutgoingRequest = OutgoingRequest;
-exports.IncomingResponse = IncomingResponse;
-exports.Agent = Agent;
-exports.globalAgent = <span class="literal">undefined</span>;
-exports.request = <span class="function"><span class="keyword">function</span> <span class="title">request</span><span class="params">(options, callback)</span> {</span>
-  <span class="keyword">return</span> (options.agent || exports.globalAgent).request(options, callback);
-};
-exports.get = <span class="function"><span class="keyword">function</span> <span class="title">get</span><span class="params">(options, callback)</span> {</span>
-  <span class="keyword">return</span> (options.agent || exports.globalAgent).get(options, callback);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-48">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h2">
-                <a class="pilcrow" href="#section-48">&#182;</a>
-              </div>
-              <h2>Agent class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-49">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-49">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">Agent</span><span class="params">(options)</span> {</span>
-  EventEmitter.call(<span class="keyword">this</span>);
-
-  options = util._extend({}, options);
-
-  <span class="keyword">this</span>._settings = options.settings;
-  <span class="keyword">this</span>._log = (options.log || defaultLogger).child({ component: <span class="string">'http'</span> });
-  <span class="keyword">this</span>.endpoints = {};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-50">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-50">&#182;</a>
-              </div>
-              <ul>
-<li>Using an own HTTPS agent, because the global agent does not look at <code>NPN/ALPNProtocols</code> when
-generating the key identifying the connection, so we may get useless non-negotiated TLS
-channels even if we ask for a negotiated one. This agent will contain only negotiated
-channels.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">var</span> agentOptions = {};
-  agentOptions.ALPNProtocols = supportedProtocols;
-  agentOptions.NPNProtocols = supportedProtocols;
-  <span class="keyword">this</span>._httpsAgent = <span class="keyword">new</span> https.Agent(agentOptions);
-
-  <span class="keyword">this</span>.sockets = <span class="keyword">this</span>._httpsAgent.sockets;
-  <span class="keyword">this</span>.requests = <span class="keyword">this</span>._httpsAgent.requests;
-}
-Agent.prototype = Object.create(EventEmitter.prototype, { constructor: { value: Agent } });
-
-Agent.prototype.request = <span class="function"><span class="keyword">function</span> <span class="title">request</span><span class="params">(options, callback)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">typeof</span> options === <span class="string">'string'</span>) {
-    options = url.parse(options);
-  } <span class="keyword">else</span> {
-    options = util._extend({}, options);
-  }
-
-  options.method = (options.method || <span class="string">'GET'</span>).toUpperCase();
-  options.protocol = options.protocol || <span class="string">'https:'</span>;
-  options.host = options.hostname || options.host || <span class="string">'localhost'</span>;
-  options.port = options.port || <span class="number">443</span>;
-  options.path = options.path || <span class="string">'/'</span>;
-
-  <span class="keyword">if</span> (!options.plain &amp;&amp; options.protocol === <span class="string">'http:'</span>) {
-    <span class="keyword">this</span>._log.error(<span class="string">'Trying to negotiate client request with Upgrade from HTTP/1.1'</span>);
-    <span class="keyword">throw</span> <span class="keyword">new</span> Error(<span class="string">'HTTP1.1 -&gt; HTTP2 upgrade is not yet supported.'</span>);
-  }
-
-  <span class="keyword">var</span> request = <span class="keyword">new</span> OutgoingRequest(<span class="keyword">this</span>._log);
-
-  <span class="keyword">if</span> (callback) {
-    request.on(<span class="string">'response'</span>, callback);
-  }
-
-  <span class="keyword">var</span> key = [
-    !!options.plain,
-    options.host,
-    options.port
-  ].join(<span class="string">':'</span>);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-51">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-51">&#182;</a>
-              </div>
-              <ul>
-<li>There&#39;s an existing HTTP/2 connection to this host</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (key <span class="keyword">in</span> <span class="keyword">this</span>.endpoints) {
-    <span class="keyword">var</span> endpoint = <span class="keyword">this</span>.endpoints[key];
-    request._start(endpoint.createStream(), options);
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-52">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-52">&#182;</a>
-              </div>
-              <ul>
-<li>HTTP/2 over plain TCP</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> <span class="keyword">if</span> (options.plain) {
-    endpoint = <span class="keyword">new</span> Endpoint(<span class="keyword">this</span>._log, <span class="string">'CLIENT'</span>, <span class="keyword">this</span>._settings);
-    endpoint.socket = net.connect({
-      host: options.host,
-      port: options.port,
-      localAddress: options.localAddress
-    });
-    endpoint.pipe(endpoint.socket).pipe(endpoint);
-    request._start(endpoint.createStream(), options);
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-53">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-53">&#182;</a>
-              </div>
-              <ul>
-<li>HTTP/2 over TLS negotiated using NPN or ALPN</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> {
-    <span class="keyword">var</span> started = <span class="literal">false</span>;
-    options.ALPNProtocols = supportedProtocols;
-    options.NPNProtocols = supportedProtocols;
-    options.servername = options.host; <span class="comment">// Server Name Indication</span>
-    options.agent = <span class="keyword">this</span>._httpsAgent;
-    <span class="keyword">var</span> httpsRequest = https.request(options);
-
-    httpsRequest.on(<span class="string">'socket'</span>, <span class="keyword">function</span>(socket) {
-      <span class="keyword">var</span> negotiatedProtocol = socket.alpnProtocol || socket.npnProtocol;
-      <span class="keyword">if</span> (negotiatedProtocol !== <span class="literal">undefined</span>) {
-        negotiated();
-      } <span class="keyword">else</span> {
-        socket.on(<span class="string">'secureConnect'</span>, negotiated);
-      }
-    });
-
-    <span class="keyword">var</span> self = <span class="keyword">this</span>;
-    <span class="function"><span class="keyword">function</span> <span class="title">negotiated</span><span class="params">()</span> {</span>
-      <span class="keyword">var</span> endpoint;
-      <span class="keyword">var</span> negotiatedProtocol = httpsRequest.socket.alpnProtocol || httpsRequest.socket.npnProtocol;
-      <span class="keyword">if</span> (negotiatedProtocol === implementedVersion) {
-        httpsRequest.socket.emit(<span class="string">'agentRemove'</span>);
-        unbundleSocket(httpsRequest.socket);
-        endpoint = <span class="keyword">new</span> Endpoint(self._log, <span class="string">'CLIENT'</span>, self._settings);
-        endpoint.socket = httpsRequest.socket;
-        endpoint.pipe(endpoint.socket).pipe(endpoint);
-      }
-      <span class="keyword">if</span> (started) {
-        <span class="keyword">if</span> (endpoint) {
-          endpoint.close();
-        } <span class="keyword">else</span> {
-          httpsRequest.abort();
-        }
-      } <span class="keyword">else</span> {
-        <span class="keyword">if</span> (endpoint) {
-          self._log.info({ e: endpoint, server: options.host + <span class="string">':'</span> + options.port },
-                         <span class="string">'New outgoing HTTP/2 connection'</span>);
-          self.endpoints[key] = endpoint;
-          self.emit(key, endpoint);
-        } <span class="keyword">else</span> {
-          self.emit(key, <span class="literal">undefined</span>);
-        }
-      }
-    }
-
-    <span class="keyword">this</span>.once(key, <span class="keyword">function</span>(endpoint) {
-      started = <span class="literal">true</span>;
-      <span class="keyword">if</span> (endpoint) {
-        request._start(endpoint.createStream(), options);
-      } <span class="keyword">else</span> {
-        request._fallback(httpsRequest);
-      }
-    });
-  }
-
-  <span class="keyword">return</span> request;
-};
-
-Agent.prototype.get = <span class="function"><span class="keyword">function</span> <span class="title">get</span><span class="params">(options, callback)</span> {</span>
-  <span class="keyword">var</span> request = <span class="keyword">this</span>.request(options, callback);
-  request.end();
-  <span class="keyword">return</span> request;
-};
-
-<span class="function"><span class="keyword">function</span> <span class="title">unbundleSocket</span><span class="params">(socket)</span> {</span>
-  socket.removeAllListeners(<span class="string">'data'</span>);
-  socket.removeAllListeners(<span class="string">'end'</span>);
-  socket.removeAllListeners(<span class="string">'readable'</span>);
-  socket.removeAllListeners(<span class="string">'close'</span>);
-  socket.removeAllListeners(<span class="string">'error'</span>);
-  socket.unpipe();
-  <span class="keyword">delete</span> socket.ondata;
-  <span class="keyword">delete</span> socket.onend;
-}
-
-Object.defineProperty(Agent.prototype, <span class="string">'maxSockets'</span>, {
-  get: <span class="function"><span class="keyword">function</span> <span class="title">getMaxSockets</span><span class="params">()</span> {</span>
-    <span class="keyword">return</span> <span class="keyword">this</span>._httpsAgent.maxSockets;
-  },
-  set: <span class="function"><span class="keyword">function</span> <span class="title">setMaxSockets</span><span class="params">(value)</span> {</span>
-    <span class="keyword">this</span>._httpsAgent.maxSockets = value;
-  }
-});
-
-exports.globalAgent = <span class="keyword">new</span> Agent();</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-54">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h2">
-                <a class="pilcrow" href="#section-54">&#182;</a>
-              </div>
-              <h2>OutgoingRequest class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-55">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-55">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">OutgoingRequest</span><span class="params">()</span> {</span>
-  OutgoingMessage.call(<span class="keyword">this</span>);
-
-  <span class="keyword">this</span>._log = <span class="literal">undefined</span>;
-
-  <span class="keyword">this</span>.stream = <span class="literal">undefined</span>;
-}
-OutgoingRequest.prototype = Object.create(OutgoingMessage.prototype, { constructor: { value: OutgoingRequest } });
-
-OutgoingRequest.prototype._start = <span class="function"><span class="keyword">function</span> <span class="title">_start</span><span class="params">(stream, options)</span> {</span>
-  <span class="keyword">this</span>.stream = stream;
-
-  <span class="keyword">this</span>._log = stream._log.child({ component: <span class="string">'http'</span> });
-
-  <span class="keyword">for</span> (<span class="keyword">var</span> key <span class="keyword">in</span> options.headers) {
-    <span class="keyword">this</span>.setHeader(key, options.headers[key]);
-  }
-  <span class="keyword">var</span> headers = <span class="keyword">this</span>._headers;
-  <span class="keyword">delete</span> headers.host;
-
-  <span class="keyword">if</span> (options.auth) {
-    headers.authorization = <span class="string">'Basic '</span> + <span class="keyword">new</span> Buffer(options.auth).toString(<span class="string">'base64'</span>);
-  }
-
-  headers[<span class="string">':scheme'</span>] = options.protocol.slice(<span class="number">0</span>, -<span class="number">1</span>);
-  headers[<span class="string">':method'</span>] = options.method;
-  headers[<span class="string">':authority'</span>] = options.host;
-  headers[<span class="string">':path'</span>] = options.path;
-
-  <span class="keyword">this</span>._log.info({ scheme: headers[<span class="string">':scheme'</span>], method: headers[<span class="string">':method'</span>],
-                   authority: headers[<span class="string">':authority'</span>], path: headers[<span class="string">':path'</span>],
-                   headers: (options.headers || {}) }, <span class="string">'Sending request'</span>);
-  <span class="keyword">this</span>.stream.headers(headers);
-  <span class="keyword">this</span>.headersSent = <span class="literal">true</span>;
-
-  <span class="keyword">this</span>.emit(<span class="string">'socket'</span>, <span class="keyword">this</span>.stream);
-
-  <span class="keyword">var</span> response = <span class="keyword">new</span> IncomingResponse(<span class="keyword">this</span>.stream);
-  response.once(<span class="string">'ready'</span>, <span class="keyword">this</span>.emit.bind(<span class="keyword">this</span>, <span class="string">'response'</span>, response));
-
-  <span class="keyword">this</span>.stream.on(<span class="string">'promise'</span>, <span class="keyword">this</span>._onPromise.bind(<span class="keyword">this</span>));
-};
-
-OutgoingRequest.prototype._fallback = <span class="function"><span class="keyword">function</span> <span class="title">_fallback</span><span class="params">(request)</span> {</span>
-  request.on(<span class="string">'response'</span>, <span class="keyword">this</span>.emit.bind(<span class="keyword">this</span>, <span class="string">'response'</span>));
-  <span class="keyword">this</span>.stream = <span class="keyword">this</span>.request = request;
-  <span class="keyword">this</span>.emit(<span class="string">'socket'</span>, <span class="keyword">this</span>.socket);
-};
-
-OutgoingRequest.prototype.setPriority = <span class="function"><span class="keyword">function</span> <span class="title">setPriority</span><span class="params">(priority)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.stream) {
-    <span class="keyword">this</span>.stream.priority(priority);
-  } <span class="keyword">else</span> {
-    <span class="keyword">this</span>.once(<span class="string">'socket'</span>, <span class="keyword">this</span>.setPriority.bind(<span class="keyword">this</span>, priority));
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-56">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-56">&#182;</a>
-              </div>
-              <p>Overriding <code>EventEmitter</code>&#39;s <code>on(event, listener)</code> method to forward certain subscriptions to
-<code>request</code>. See <code>Server.prototype.on</code> for explanation.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>OutgoingRequest.prototype.on = <span class="function"><span class="keyword">function</span> <span class="title">on</span><span class="params">(event, listener)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.request &amp;&amp; (event === <span class="string">'upgrade'</span>)) {
-    <span class="keyword">this</span>.request.on(event, listener &amp;&amp; listener.bind(<span class="keyword">this</span>));
-  } <span class="keyword">else</span> {
-    OutgoingMessage.prototype.on.call(<span class="keyword">this</span>, event, listener);
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-57">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-57">&#182;</a>
-              </div>
-              <p>Methods only in fallback mode</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>OutgoingRequest.prototype.setNoDelay = <span class="function"><span class="keyword">function</span> <span class="title">setNoDelay</span><span class="params">(noDelay)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.request) {
-    <span class="keyword">this</span>.request.setNoDelay(noDelay);
-  } <span class="keyword">else</span> <span class="keyword">if</span> (!<span class="keyword">this</span>.stream) {
-    <span class="keyword">this</span>.on(<span class="string">'socket'</span>, <span class="keyword">this</span>.setNoDelay.bind(<span class="keyword">this</span>, noDelay));
-  }
-};
-
-OutgoingRequest.prototype.setSocketKeepAlive = <span class="function"><span class="keyword">function</span> <span class="title">setSocketKeepAlive</span><span class="params">(enable, initialDelay)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.request) {
-    <span class="keyword">this</span>.request.setSocketKeepAlive(enable, initialDelay);
-  } <span class="keyword">else</span> <span class="keyword">if</span> (!<span class="keyword">this</span>.stream) {
-    <span class="keyword">this</span>.on(<span class="string">'socket'</span>, <span class="keyword">this</span>.setSocketKeepAlive.bind(<span class="keyword">this</span>, enable, initialDelay));
-  }
-};
-
-OutgoingRequest.prototype.setTimeout = <span class="function"><span class="keyword">function</span> <span class="title">setTimeout</span><span class="params">(timeout, callback)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.request) {
-    <span class="keyword">this</span>.request.setTimeout(timeout, callback);
-  } <span class="keyword">else</span> <span class="keyword">if</span> (!<span class="keyword">this</span>.stream) {
-    <span class="keyword">this</span>.on(<span class="string">'socket'</span>, <span class="keyword">this</span>.setTimeout.bind(<span class="keyword">this</span>, timeout, callback));
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-58">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-58">&#182;</a>
-              </div>
-              <p>Aborting the request</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>OutgoingRequest.prototype.abort = <span class="function"><span class="keyword">function</span> <span class="title">abort</span><span class="params">()</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>.request) {
-    <span class="keyword">this</span>.request.abort();
-  } <span class="keyword">else</span> <span class="keyword">if</span> (<span class="keyword">this</span>.stream) {
-    <span class="keyword">this</span>.stream.reset(<span class="string">'CANCEL'</span>);
-  } <span class="keyword">else</span> {
-    <span class="keyword">this</span>.on(<span class="string">'socket'</span>, <span class="keyword">this</span>.abort.bind(<span class="keyword">this</span>));
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-59">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-59">&#182;</a>
-              </div>
-              <p>Receiving push promises</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>OutgoingRequest.prototype._onPromise = <span class="function"><span class="keyword">function</span> <span class="title">_onPromise</span><span class="params">(stream, headers)</span> {</span>
-  <span class="keyword">this</span>._log.info({ push_stream: stream.id }, <span class="string">'Receiving push promise'</span>);
-
-  <span class="keyword">var</span> promise = <span class="keyword">new</span> IncomingPromise(stream, headers);
-
-  <span class="keyword">if</span> (<span class="keyword">this</span>.listeners(<span class="string">'push'</span>).length &gt; <span class="number">0</span>) {
-    <span class="keyword">this</span>.emit(<span class="string">'push'</span>, promise);
-  } <span class="keyword">else</span> {
-    promise.cancel();
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-60">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h2">
-                <a class="pilcrow" href="#section-60">&#182;</a>
-              </div>
-              <h2>IncomingResponse class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-61">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-61">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">IncomingResponse</span><span class="params">(stream)</span> {</span>
-  IncomingMessage.call(<span class="keyword">this</span>, stream);
-}
-IncomingResponse.prototype = Object.create(IncomingMessage.prototype, { constructor: { value: IncomingResponse } });</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-62">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-62">&#182;</a>
-              </div>
-              <p><a href="http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-8.1.3.2">Response Header Fields</a>
-* <code>headers</code> argument: HTTP/2.0 request and response header fields carry information as a series
-  of key-value pairs. This includes the target URI for the request, the status code for the
-  response, as well as HTTP header fields.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>IncomingResponse.prototype._onHeaders = <span class="function"><span class="keyword">function</span> <span class="title">_onHeaders</span><span class="params">(headers)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-63">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-63">&#182;</a>
-              </div>
-              <ul>
-<li>A single &quot;:status&quot; header field is defined that carries the HTTP status code field. This
-header field MUST be included in all responses.</li>
-<li>A client MUST treat the absence of the &quot;:status&quot; header field, the presence of multiple
-values, or an invalid value as a stream error of type PROTOCOL_ERROR.
-Note: currently, we do not enforce it strictly: we accept any format, and parse it as int</li>
-<li>HTTP/2.0 does not define a way to carry the reason phrase that is included in an HTTP/1.1
-status line.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>.statusCode = parseInt(<span class="keyword">this</span>._checkSpecialHeader(<span class="string">':status'</span>, headers[<span class="string">':status'</span>]));</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-64">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-64">&#182;</a>
-              </div>
-              <ul>
-<li>Handling regular headers.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  IncomingMessage.prototype._onHeaders.call(<span class="keyword">this</span>, headers);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-65">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-65">&#182;</a>
-              </div>
-              <ul>
-<li>Signaling that the headers arrived.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._log.info({ status: <span class="keyword">this</span>.statusCode, headers: <span class="keyword">this</span>.headers}, <span class="string">'Incoming response'</span>);
-  <span class="keyword">this</span>.emit(<span class="string">'ready'</span>);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-66">
-            <div class="annotation">
-              
-              <div class="pilwrap for-h2">
-                <a class="pilcrow" href="#section-66">&#182;</a>
-              </div>
-              <h2>IncomingPromise class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-67">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-67">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">IncomingPromise</span><span class="params">(responseStream, promiseHeaders)</span> {</span>
-  <span class="keyword">var</span> stream = <span class="keyword">new</span> Readable();
-  stream._read = noop;
-  stream.push(<span class="literal">null</span>);
-  stream._log = responseStream._log;
-
-  IncomingRequest.call(<span class="keyword">this</span>, stream);
-
-  <span class="keyword">this</span>._onHeaders(promiseHeaders);
-
-  <span class="keyword">this</span>._responseStream = responseStream;
-
-  <span class="keyword">var</span> response = <span class="keyword">new</span> IncomingResponse(<span class="keyword">this</span>._responseStream);
-  response.once(<span class="string">'ready'</span>, <span class="keyword">this</span>.emit.bind(<span class="keyword">this</span>, <span class="string">'response'</span>, response));
-
-  <span class="keyword">this</span>.stream.on(<span class="string">'promise'</span>, <span class="keyword">this</span>._onPromise.bind(<span class="keyword">this</span>));
-}
-IncomingPromise.prototype = Object.create(IncomingRequest.prototype, { constructor: { value: IncomingPromise } });
-
-IncomingPromise.prototype.cancel = <span class="function"><span class="keyword">function</span> <span class="title">cancel</span><span class="params">()</span> {</span>
-  <span class="keyword">this</span>._responseStream.reset(<span class="string">'CANCEL'</span>);
-};
-
-IncomingPromise.prototype.setPriority = <span class="function"><span class="keyword">function</span> <span class="title">setPriority</span><span class="params">(priority)</span> {</span>
-  <span class="keyword">this</span>._responseStream.priority(priority);
-};
-
-IncomingPromise.prototype._onPromise = OutgoingRequest.prototype._onPromise;</pre></div></div>
-            
-        </li>
-        
-    </ul>
-  </div>
-</body>
-</html>
deleted file mode 100644
--- a/testing/xpcshell/node-http2/doc/index.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-  <title>index.js</title>
-  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
-  <link rel="stylesheet" media="all" href="docco.css" />
-</head>
-<body>
-  <div id="container">
-    <div id="background"></div>
-    
-      <ul id="jump_to">
-        <li>
-          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
-          <a class="small" href="javascript:void(0);">+</a>
-          <div id="jump_wrapper">
-          <div id="jump_page">
-            
-              
-              <a class="source" href="http.html">
-                http.js
-              </a>
-            
-              
-              <a class="source" href="index.html">
-                index.js
-              </a>
-            
-          </div>
-        </li>
-      </ul>
-    
-    <ul class="sections">
-        
-          <li id="title">
-              <div class="annotation">
-                  <h1>index.js</h1>
-              </div>
-          </li>
-        
-        
-        
-        <li id="section-1">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-1">&#182;</a>
-              </div>
-              <p><a href="https://github.com/molnarg/node-http2">node-http2</a> is an <a href="http://tools.ietf.org/html/draft-ietf-httpbis-http2-09">HTTP/2 (draft 09)</a> implementation for <a href="http://nodejs.org/">node.js</a>.</p>
-<p>The core of the protocol is implemented by the <a href="https://github.com/molnarg/node-http2-protocol">http2-protocol</a> module. This module provides
-two important features on top of http2-protocol:</p>
-<ul>
-<li><p>Implementation of different negotiation schemes that can be used to start a HTTP2 connection.
-These include TLS ALPN, Upgrade and Plain TCP.</p>
-</li>
-<li><p>Providing an API very similar to the standard node.js <a href="http://nodejs.org/api/https.html">HTTPS module API</a>
-(which is in turn very similar to the <a href="http://nodejs.org/api/http.html">HTTP module API</a>).</p>
-</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>module.exports   = require(<span class="string">'./http'</span>);
-
-<span class="comment">/*
-                  HTTP API
-
-               |            ^
-               |            |
- +-------------|------------|------------------------------------------------------+
- |             |            |        Server/Agent                                  |
- |             v            |                                                      |
- |        +----------+ +----------+                                                |
- |        | Outgoing | | Incoming |                                                |
- |        | req/res. | | req/res. |                                                |
- |        +----------+ +----------+                                                |
- |             |            ^                                                      |
- |             |            |                                                      |
- |   +---------|------------|-------------------------------------+   +-----       |
- |   |         |            |   Endpoint                          |   |            |
- |   |         |            |                                     |   |            |
- |   |         v            |                                     |   |            |
- |   |    +-----------------------+  +--------------------        |   |            |
- |   |    |        Stream         |  |         Stream      ...    |   |            |
- |   |    +-----------------------+  +--------------------        |   |            |
- |   |                                                            |   |            |
- |   +------------------------------------------------------------+   +-----       |
- |                             |        |                                          |
- |                             |        |                                          |
- |                             v        |                                          |
- |   +------------------------------------------------------------+   +-----       |
- |   |                         TCP stream                         |   |      ...   |
- |   +------------------------------------------------------------+   +-----       |
- |                                                                                 |
- +---------------------------------------------------------------------------------+
-
-*/</span></pre></div></div>
-            
-        </li>
-        
-    </ul>
-  </div>
-</body>
-</html>
deleted file mode 100755
index 1b32532a8e40e483069482c3650c3ef22ef16bdd..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index dc4cc9c27a59ab14fbb7444c6ab35c5b33a034f6..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index fa16fd0aba81582de121d833c7bc50e8f1b1b981..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index 40bd654b5fe63501ae64d5673b5aa45051a69e65..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index c2c72902a1b6ecb6e22376256a3ece17dd100a30..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index 81a09d18ecdfdc5be11d55912268014b4d2d4d9f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index 98a9a7fbabb1083aca5143bc306e228886ff2eeb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index 2af39b08b07df11423ac44c1fb2ff0ca82e81346..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index de558b5a29bcb4445be8ffd739c929bf4d3730af..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/testing/xpcshell/node-http2/doc/public/stylesheets/normalize.css
+++ /dev/null
@@ -1,375 +0,0 @@
-/*! normalize.css v2.0.1 | MIT License | git.io/normalize */
-
-/* ==========================================================================
-   HTML5 display definitions
-   ========================================================================== */
-
-/*
- * Corrects `block` display not defined in IE 8/9.
- */
-
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-nav,
-section,
-summary {
-    display: block;
-}
-
-/*
- * Corrects `inline-block` display not defined in IE 8/9.
- */
-
-audio,
-canvas,
-video {
-    display: inline-block;
-}
-
-/*
- * Prevents modern browsers from displaying `audio` without controls.
- * Remove excess height in iOS 5 devices.
- */
-
-audio:not([controls]) {
-    display: none;
-    height: 0;
-}
-
-/*
- * Addresses styling for `hidden` attribute not present in IE 8/9.
- */
-
-[hidden] {
-    display: none;
-}
-
-/* ==========================================================================
-   Base
-   ========================================================================== */
-
-/*
- * 1. Sets default font family to sans-serif.
- * 2. Prevents iOS text size adjust after orientation change, without disabling
- *    user zoom.
- */
-
-html {
-    font-family: sans-serif; /* 1 */
-    -webkit-text-size-adjust: 100%; /* 2 */
-    -ms-text-size-adjust: 100%; /* 2 */
-}
-
-/*
- * Removes default margin.
- */
-
-body {
-    margin: 0;
-}
-
-/* ==========================================================================
-   Links
-   ========================================================================== */
-
-/*
- * Addresses `outline` inconsistency between Chrome and other browsers.
- */
-
-a:focus {
-    outline: thin dotted;
-}
-
-/*
- * Improves readability when focused and also mouse hovered in all browsers.
- */
-
-a:active,
-a:hover {
-    outline: 0;
-}
-
-/* ==========================================================================
-   Typography
-   ========================================================================== */
-
-/*
- * Addresses `h1` font sizes within `section` and `article` in Firefox 4+,
- * Safari 5, and Chrome.
- */
-
-h1 {
-    font-size: 2em;
-}
-
-/*
- * Addresses styling not present in IE 8/9, Safari 5, and Chrome.
- */
-
-abbr[title] {
-    border-bottom: 1px dotted;
-}
-
-/*
- * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
- */
-
-b,
-strong {
-    font-weight: bold;
-}
-
-/*
- * Addresses styling not present in Safari 5 and Chrome.
- */
-
-dfn {
-    font-style: italic;
-}
-
-/*
- * Addresses styling not present in IE 8/9.
- */
-
-mark {
-    background: #ff0;
-    color: #000;
-}
-
-
-/*
- * Corrects font family set oddly in Safari 5 and Chrome.
- */
-
-code,
-kbd,
-pre,
-samp {
-    font-family: monospace, serif;
-    font-size: 1em;
-}
-
-/*
- * Improves readability of pre-formatted text in all browsers.
- */
-
-pre {
-    white-space: pre;
-    white-space: pre-wrap;
-    word-wrap: break-word;
-}
-
-/*
- * Sets consistent quote types.
- */
-
-q {
-    quotes: "\201C" "\201D" "\2018" "\2019";
-}
-
-/*
- * Addresses inconsistent and variable font size in all browsers.
- */
-
-small {
-    font-size: 80%;
-}
-
-/*
- * Prevents `sub` and `sup` affecting `line-height` in all browsers.
- */
-
-sub,
-sup {
-    font-size: 75%;
-    line-height: 0;
-    position: relative;
-    vertical-align: baseline;
-}
-
-sup {
-    top: -0.5em;
-}
-
-sub {
-    bottom: -0.25em;
-}
-
-/* ==========================================================================
-   Embedded content
-   ========================================================================== */
-
-/*
- * Removes border when inside `a` element in IE 8/9.
- */
-
-img {
-    border: 0;
-}
-
-/*
- * Corrects overflow displayed oddly in IE 9.
- */
-
-svg:not(:root) {
-    overflow: hidden;
-}
-
-/* ==========================================================================
-   Figures
-   ========================================================================== */
-
-/*
- * Addresses margin not present in IE 8/9 and Safari 5.
- */
-
-figure {
-    margin: 0;
-}
-
-/* ==========================================================================
-   Forms
-   ========================================================================== */
-
-/*
- * Define consistent border, margin, and padding.
- */
-
-fieldset {
-    border: 1px solid #c0c0c0;
-    margin: 0 2px;
-    padding: 0.35em 0.625em 0.75em;
-}
-
-/*
- * 1. Corrects color not being inherited in IE 8/9.
- * 2. Remove padding so people aren't caught out if they zero out fieldsets.
- */
-
-legend {
-    border: 0; /* 1 */
-    padding: 0; /* 2 */
-}
-
-/*
- * 1. Corrects font family not being inherited in all browsers.
- * 2. Corrects font size not being inherited in all browsers.
- * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome
- */
-
-button,
-input,
-select,
-textarea {
-    font-family: inherit; /* 1 */
-    font-size: 100%; /* 2 */
-    margin: 0; /* 3 */
-}
-
-/*
- * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in
- * the UA stylesheet.
- */
-
-button,
-input {
-    line-height: normal;
-}
-
-/*
- * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
- *    and `video` controls.
- * 2. Corrects inability to style clickable `input` types in iOS.
- * 3. Improves usability and consistency of cursor style between image-type
- *    `input` and others.
- */
-
-button,
-html input[type="button"], /* 1 */
-input[type="reset"],
-input[type="submit"] {
-    -webkit-appearance: button; /* 2 */
-    cursor: pointer; /* 3 */
-}
-
-/*
- * Re-set default cursor for disabled elements.
- */
-
-button[disabled],
-input[disabled] {
-    cursor: default;
-}
-
-/*
- * 1. Addresses box sizing set to `content-box` in IE 8/9.
- * 2. Removes excess padding in IE 8/9.
- */
-
-input[type="checkbox"],
-input[type="radio"] {
-    box-sizing: border-box; /* 1 */
-    padding: 0; /* 2 */
-}
-
-/*
- * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
- * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
- *    (include `-moz` to future-proof).
- */
-
-input[type="search"] {
-    -webkit-appearance: textfield; /* 1 */
-    -moz-box-sizing: content-box;
-    -webkit-box-sizing: content-box; /* 2 */
-    box-sizing: content-box;
-}
-
-/*
- * Removes inner padding and search cancel button in Safari 5 and Chrome
- * on OS X.
- */
-
-input[type="search"]::-webkit-search-cancel-button,
-input[type="search"]::-webkit-search-decoration {
-    -webkit-appearance: none;
-}
-
-/*
- * Removes inner padding and border in Firefox 4+.
- */
-
-button::-moz-focus-inner,
-input::-moz-focus-inner {
-    border: 0;
-    padding: 0;
-}
-
-/*
- * 1. Removes default vertical scrollbar in IE 8/9.
- * 2. Improves readability and alignment in all browsers.
- */
-
-textarea {
-    overflow: auto; /* 1 */
-    vertical-align: top; /* 2 */
-}
-
-/* ==========================================================================
-   Tables
-   ========================================================================== */
-
-/*
- * Remove most spacing between table cells.
- */
-
-table {
-    border-collapse: collapse;
-    border-spacing: 0;
-}
\ No newline at end of file
--- a/testing/xpcshell/node-http2/lib/http.js
+++ b/testing/xpcshell/node-http2/lib/http.js
@@ -116,31 +116,32 @@
 //   - **request.setSocketKeepAlive([enable], [initialDelay])**
 //
 // - **Class: http2.IncomingMessage**
 //   - **Event: 'close'**
 //   - **message.setTimeout(timeout, [callback])**
 //
 // [1]: http://nodejs.org/api/https.html
 // [2]: http://nodejs.org/api/http.html
-// [3]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-8.1.3.2
+// [3]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-10#section-8.1.3.2
 // [expect-continue]: https://github.com/http2/http2-spec/issues/18
 // [connect]: https://github.com/http2/http2-spec/issues/230
 
 // Common server and client side code
 // ==================================
 
 var net = require('net');
 var url = require('url');
 var util = require('util');
 var EventEmitter = require('events').EventEmitter;
 var PassThrough = require('stream').PassThrough;
 var Readable = require('stream').Readable;
 var Writable = require('stream').Writable;
 var Endpoint = require('http2-protocol').Endpoint;
+var implementedVersion = require('http2-protocol').ImplementedVersion;
 var http = require('http');
 var https = require('https');
 
 exports.STATUS_CODES = http.STATUS_CODES;
 exports.IncomingMessage = IncomingMessage;
 exports.OutgoingMessage = OutgoingMessage;
 
 var deprecatedHeaders = [
@@ -148,20 +149,16 @@ var deprecatedHeaders = [
   'host',
   'keep-alive',
   'proxy-connection',
   'te',
   'transfer-encoding',
   'upgrade'
 ];
 
-// The implemented version of the HTTP/2 specification is [draft 09][1].
-// [1]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-09
-var implementedVersion = 'HTTP-draft-09/2.0';
-
 // When doing NPN/ALPN negotiation, HTTP/1.1 is used as fallback
 var supportedProtocols = [implementedVersion, 'http/1.1', 'http/1.0'];
 
 // Logging
 // -------
 
 // Logger shim, used when no logger is provided by the user.
 function noop() {}
@@ -202,17 +199,17 @@ function IncomingMessage(stream) {
   this._lastHeadersSeen = undefined;
 
   // * Other metadata is filled in when the headers arrive.
   stream.once('headers', this._onHeaders.bind(this));
   stream.once('end', this._onEnd.bind(this));
 }
 IncomingMessage.prototype = Object.create(PassThrough.prototype, { constructor: { value: IncomingMessage } });
 
-// [Request Header Fields](http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-8.1.3.1)
+// [Request Header Fields](http://tools.ietf.org/html/draft-ietf-httpbis-http2-10#section-8.1.3.1)
 // * `headers` argument: HTTP/2.0 request and response header fields carry information as a series
 //   of key-value pairs. This includes the target URI for the request, the status code for the
 //   response, as well as HTTP header fields.
 IncomingMessage.prototype._onHeaders = function _onHeaders(headers) {
   // * An HTTP/2.0 request or response MUST NOT include any of the following header fields:
   //   Connection, Host, Keep-Alive, Proxy-Connection, TE, Transfer-Encoding, and Upgrade. A server
   //   MUST treat the presence of any of these header fields as a stream error of type
   //   PROTOCOL_ERROR.
@@ -495,17 +492,17 @@ function createServer(options, requestLi
 // IncomingRequest class
 // ---------------------
 
 function IncomingRequest(stream) {
   IncomingMessage.call(this, stream);
 }
 IncomingRequest.prototype = Object.create(IncomingMessage.prototype, { constructor: { value: IncomingRequest } });
 
-// [Request Header Fields](http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-8.1.3.1)
+// [Request Header Fields](http://tools.ietf.org/html/draft-ietf-httpbis-http2-10#section-8.1.3.1)
 // * `headers` argument: HTTP/2.0 request and response header fields carry information as a series
 //   of key-value pairs. This includes the target URI for the request, the status code for the
 //   response, as well as HTTP header fields.
 IncomingRequest.prototype._onHeaders = function _onHeaders(headers) {
   // * The ":method" header field includes the HTTP method
   // * The ":scheme" header field includes the scheme portion of the target URI
   // * The ":authority" header field includes the authority portion of the target URI
   // * The ":path" header field includes the path and query parts of the target URI.
@@ -926,17 +923,17 @@ OutgoingRequest.prototype._onPromise = f
 // IncomingResponse class
 // ----------------------
 
 function IncomingResponse(stream) {
   IncomingMessage.call(this, stream);
 }
 IncomingResponse.prototype = Object.create(IncomingMessage.prototype, { constructor: { value: IncomingResponse } });
 
-// [Response Header Fields](http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-8.1.3.2)
+// [Response Header Fields](http://tools.ietf.org/html/draft-ietf-httpbis-http2-10#section-8.1.3.2)
 // * `headers` argument: HTTP/2.0 request and response header fields carry information as a series
 //   of key-value pairs. This includes the target URI for the request, the status code for the
 //   response, as well as HTTP header fields.
 IncomingResponse.prototype._onHeaders = function _onHeaders(headers) {
   // * A single ":status" header field is defined that carries the HTTP status code field. This
   //   header field MUST be included in all responses.
   // * A client MUST treat the absence of the ":status" header field, the presence of multiple
   //   values, or an invalid value as a stream error of type PROTOCOL_ERROR.
--- a/testing/xpcshell/node-http2/lib/index.js
+++ b/testing/xpcshell/node-http2/lib/index.js
@@ -1,22 +1,22 @@
-// [node-http2][homepage] is an [HTTP/2 (draft 09)][http2] implementation for [node.js][node].
+// [node-http2][homepage] is an [HTTP/2 (draft 10)][http2] implementation for [node.js][node].
 //
 // The core of the protocol is implemented by the [http2-protocol] module. This module provides
 // two important features on top of http2-protocol:
 //
 // * Implementation of different negotiation schemes that can be used to start a HTTP2 connection.
 //   These include TLS ALPN, Upgrade and Plain TCP.
 //
 // * Providing an API very similar to the standard node.js [HTTPS module API][node-https]
 //   (which is in turn very similar to the [HTTP module API][node-http]).
 //
 // [homepage]:            https://github.com/molnarg/node-http2
 // [http2-protocol]:      https://github.com/molnarg/node-http2-protocol
-// [http2]:               http://tools.ietf.org/html/draft-ietf-httpbis-http2-09
+// [http2]:               http://tools.ietf.org/html/draft-ietf-httpbis-http2-10
 // [node]:                http://nodejs.org/
 // [node-https]:          http://nodejs.org/api/https.html
 // [node-http]:           http://nodejs.org/api/http.html
 
 module.exports   = require('./http');
 
 /*
                   HTTP API
new file mode 100644
--- /dev/null
+++ b/testing/xpcshell/node-http2/node_modules/http2-protocol/.gitignore
@@ -0,0 +1,1 @@
+node_modules
--- a/testing/xpcshell/node-http2/node_modules/http2-protocol/HISTORY.md
+++ b/testing/xpcshell/node-http2/node_modules/http2-protocol/HISTORY.md
@@ -1,11 +1,26 @@
 Version history
 ===============
 
+### 0.10.0 (2014-03-10) ###
+
+* Upgrade to the latest draft: [draft-ietf-httpbis-http2-10][draft-10]
+
+[draft-10]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-10
+
+### 0.9.1 (2014-01-11) ###
+
+* Updated the examples (#5)
+* Fixed a compression error (#6)
+* Removed docs from the tree (but they remain [hosted on the github-page])
+* [Tarball](https://github.com/molnarg/node-http2-protocol/archive/node-http2-protocol-0.9.1.tar.gz)
+
+[hosted on the github-page]: http://molnarg.github.io/node-http2-protocol/doc/
+
 ### 0.9.0 (2013-12-25) ###
 
 * Upgrade to the latest draft: [draft-ietf-httpbis-http2-09][draft-09]
 * [Tarball](https://github.com/molnarg/node-http2-protocol/archive/node-http2-protocol-0.9.0.tar.gz)
 
 [draft-09]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-09
 
 ### 0.7.0 (2013-11-10) ###
--- a/testing/xpcshell/node-http2/node_modules/http2-protocol/README.md
+++ b/testing/xpcshell/node-http2/node_modules/http2-protocol/README.md
@@ -1,12 +1,12 @@
 node-http2-protocol
 ===================
 
-An HTTP/2 ([draft-ietf-httpbis-http2-09](http://tools.ietf.org/html/draft-ietf-httpbis-http2-09))
+An HTTP/2 ([draft-ietf-httpbis-http2-10](http://tools.ietf.org/html/draft-ietf-httpbis-http2-10))
 framing layer implementaion for node.js.
 
 Installation
 ------------
 
 ```
 npm install http2-protocol
 ```
@@ -33,29 +33,29 @@ Used libraries:
 * [istanbul](https://github.com/gotwarlost/istanbul) for code coverage analysis
 * [docco](http://jashkenas.github.io/docco/) for developer documentation
 * [bunyan](https://github.com/trentm/node-bunyan) for logging
 
 For pretty printing logs, you will also need a global install of bunyan (`npm install -g bunyan`).
 
 ### Developer documentation ###
 
-The developer documentation is located in the `doc` directory. The docs are usually updated only
-before releasing a new version. To regenerate them manually, run `npm run-script prepublish`.
-There's a hosted version which is located [here](http://molnarg.github.io/node-http2-protocol/doc/).
+The developer documentation is generated from the source code using docco and can be viewed online
+[here](http://molnarg.github.io/node-http2-protocol/doc/). If you'd like to have an offline copy,
+just run `npm run-script doc`.
 
 ### Running the tests ###
 
 It's easy, just run `npm test`. The tests are written in BDD style, so they are a good starting
 point to understand the code.
 
 ### Test coverage ###
 
 To generate a code coverage report, run `npm test --coverage` (it may be slow, be patient).
-Code coverage summary as of version 0.6.0:
+Code coverage summary as of version 0.9.0:
 ```
 Statements   : 92.43% ( 1257/1360 )
 Branches     : 86.36% ( 500/579 )
 Functions    : 90.12% ( 146/162 )
 Lines        : 92.39% ( 1251/1354 )
 ```
 
 There's a hosted version of the detailed (line-by-line) coverage report
deleted file mode 100644
--- a/testing/xpcshell/node-http2/node_modules/http2-protocol/doc/compressor.html
+++ /dev/null
@@ -1,2475 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-  <title>compressor.js</title>
-  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
-  <link rel="stylesheet" media="all" href="docco.css" />
-</head>
-<body>
-  <div id="container">
-    <div id="background"></div>
-    
-      <ul id="jump_to">
-        <li>
-          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
-          <a class="small" href="javascript:void(0);">+</a>
-          <div id="jump_wrapper">
-          <div id="jump_page">
-            
-              
-              <a class="source" href="compressor.html">
-                compressor.js
-              </a>
-            
-              
-              <a class="source" href="connection.html">
-                connection.js
-              </a>
-            
-              
-              <a class="source" href="endpoint.html">
-                endpoint.js
-              </a>
-            
-              
-              <a class="source" href="flow.html">
-                flow.js
-              </a>
-            
-              
-              <a class="source" href="framer.html">
-                framer.js
-              </a>
-            
-              
-              <a class="source" href="index.html">
-                index.js
-              </a>
-            
-              
-              <a class="source" href="stream.html">
-                stream.js
-              </a>
-            
-          </div>
-        </li>
-      </ul>
-    
-    <ul class="sections">
-        
-          <li id="title">
-              <div class="annotation">
-                  <h1>compressor.js</h1>
-              </div>
-          </li>
-        
-        
-        
-        <li id="section-1">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-1">&#182;</a>
-              </div>
-              <p>The implementation of the <a href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05">HTTP/2 Header Compression</a> spec is separated from
-the &#39;integration&#39; part which handles HEADERS and PUSH_PROMISE frames. The compression itself is
-implemented in the first part of the file, and consists of three classes: <code>HeaderTable</code>,
-<code>HeaderSetDecompressor</code> and <code>HeaderSetCompressor</code>. The two latter classes are
-<a href="http://nodejs.org/api/stream.html#stream_class_stream_transform">Transform Stream</a> subclasses that operate in <a href="http://nodejs.org/api/stream.html#stream_new_stream_readable_options">object mode</a>.
-These transform chunks of binary data into <code>[name, value]</code> pairs and vice versa, and store their
-state in <code>HeaderTable</code> instances.</p>
-<p>The &#39;integration&#39; part is also implemented by two <a href="http://nodejs.org/api/stream.html#stream_class_stream_transform">Transform Stream</a> subclasses
-that operate in <a href="http://nodejs.org/api/stream.html#stream_new_stream_readable_options">object mode</a>: the <code>Compressor</code> and the <code>Decompressor</code>. These
-provide a layer between the <a href="framer.html">framer</a> and the
-<a href="connection.html">connection handling component</a>.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>exports.HeaderTable = HeaderTable;
-exports.HuffmanTable = HuffmanTable;
-exports.HeaderSetCompressor = HeaderSetCompressor;
-exports.HeaderSetDecompressor = HeaderSetDecompressor;
-exports.Compressor = Compressor;
-exports.Decompressor = Decompressor;
-
-<span class="keyword">var</span> TransformStream = require(<span class="string">'stream'</span>).Transform;
-<span class="keyword">var</span> assert = require(<span class="string">'assert'</span>);
-<span class="keyword">var</span> util = require(<span class="string">'util'</span>);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-2">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-2">&#182;</a>
-              </div>
-              <h1 id="header-compression">Header compression</h1>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-3">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-3">&#182;</a>
-              </div>
-              <h2 id="the-headertable-class">The HeaderTable class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-4">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-4">&#182;</a>
-              </div>
-              <p>The <a href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05#section-3.1.2">Header Table</a> is a component used to associate headers to index values. It is basically an
-ordered list of <code>[name, value]</code> pairs, so it&#39;s implemented as a subclass of <code>Array</code>.
-In this implementation, the Header Table and the <a href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05#appendix-B">Static Table</a> are handled as a single table.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">HeaderTable</span><span class="params">(log, limit)</span> {</span>
-  <span class="keyword">var</span> self = HeaderTable.staticTable.map(entryFromPair);
-  self._log = log;
-  self._limit = limit || DEFAULT_HEADER_TABLE_LIMIT;
-  self._staticLength = self.length;
-  self._size = <span class="number">0</span>;
-  self._enforceLimit = HeaderTable.prototype._enforceLimit;
-  self.add = HeaderTable.prototype.add;
-  self.setSizeLimit = HeaderTable.prototype.setSizeLimit;
-  <span class="keyword">return</span> self;
-}</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-5">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-5">&#182;</a>
-              </div>
-              <p>There are few more sets that are needed for the compression/decompression process that are all
-subsets of the Header Table, and are implemented as flags on header table entries:</p>
-<ul>
-<li><a href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05#section-3.1.3">Reference Set</a>: contains a group of headers used as a reference for the
-differential encoding of a new set of headers. (<code>reference</code> flag)</li>
-<li>Emitted headers: the headers that are already emitted as part of the current decompression
-process (not part of the spec, <code>emitted</code> flag)</li>
-<li>Headers to be kept: headers that should not be removed as the last step of the encoding process
-(not part of the spec, <code>keep</code> flag)</li>
-</ul>
-<p>Relations of the sets:</p>
-<pre><code>,----------------------------------.
-|           Header Table           |
-|                                  |
-|  ,----------------------------.  |
-|  |        Reference Set       |  |
-|  |                            |  |
-|  |  ,---------.  ,---------.  |  |
-|  |  |  Keep   |  | Emitted |  |  |
-|  |  |         |  |         |  |  |
-|  |  `---------&#39;  `---------&#39;  |  |
-|  `----------------------------&#39;  |
-`----------------------------------&#39;</code></pre>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">entryFromPair</span><span class="params">(pair)</span> {</span>
-  <span class="keyword">var</span> entry = pair.slice();
-  entry.reference = <span class="literal">false</span>;
-  entry.emitted = <span class="literal">false</span>;
-  entry.keep = <span class="literal">false</span>;
-  entry._size = size(entry);
-  <span class="keyword">return</span> entry;
-}</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-6">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-6">&#182;</a>
-              </div>
-              <p>The encoder decides how to update the header table and as such can control how much memory is
-used by the header table.  To limit the memory requirements on the decoder side, the header table
-size is bounded.</p>
-<ul>
-<li>The default header table size limit is 4096 bytes.</li>
-<li>The size of an entry is defined as follows: the size of an entry is the sum of its name&#39;s
-length in bytes, of its value&#39;s length in bytes and of 32 bytes.</li>
-<li>The size of a header table is the sum of the size of its entries.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> DEFAULT_HEADER_TABLE_LIMIT = <span class="number">4096</span>;
-
-<span class="function"><span class="keyword">function</span> <span class="title">size</span><span class="params">(entry)</span> {</span>
-  <span class="keyword">return</span> (<span class="keyword">new</span> Buffer(entry[<span class="number">0</span>] + entry[<span class="number">1</span>], <span class="string">'utf8'</span>)).length + <span class="number">32</span>;
-}</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-7">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-7">&#182;</a>
-              </div>
-              <p>The <code>add(index, entry)</code> can be used to <a href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05#section-3.3">manage the header table</a>:</p>
-<ul>
-<li>it pushes the new <code>entry</code> at the beggining of the table</li>
-<li><p>before doing such a modification, it has to be ensured that the header table size will stay
-lower than or equal to the header table size limit. To achieve this, entries are evicted from
-the end of the header table until the size of the header table is less than or equal to
-<code>(this._limit - entry.size)</code>, or until the table is empty.</p>
-<pre><code>       &lt;----------  Index Address Space ----------&gt;
-       &lt;-- Header  Table --&gt;  &lt;-- Static  Table --&gt;
-       +---+-----------+---+  +---+-----------+---+
-       | 0 |    ...    | k |  |k+1|    ...    | n |
-       +---+-----------+---+  +---+-----------+---+
-       ^                   |
-       |                   V
-Insertion Point       Drop Point</code></pre>
-</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderTable.prototype._enforceLimit = <span class="function"><span class="keyword">function</span> <span class="title">_enforceLimit</span><span class="params">(limit)</span> {</span>
-  <span class="keyword">var</span> droppedEntries = [];
-  <span class="keyword">var</span> dropPoint = <span class="keyword">this</span>.length - <span class="keyword">this</span>._staticLength;
-  <span class="keyword">while</span> ((<span class="keyword">this</span>._size &gt; limit) &amp;&amp; (dropPoint &gt; <span class="number">0</span>)) {
-    dropPoint -= <span class="number">1</span>;
-    <span class="keyword">var</span> dropped = <span class="keyword">this</span>.splice(dropPoint, <span class="number">1</span>)[<span class="number">0</span>];
-    <span class="keyword">this</span>._size -= dropped._size;
-    droppedEntries[droppedEntries] = dropped;
-  }
-  <span class="keyword">return</span> droppedEntries;
-};
-
-HeaderTable.prototype.add = <span class="function"><span class="keyword">function</span><span class="params">(entry)</span> {</span>
-  <span class="keyword">var</span> limit = <span class="keyword">this</span>._limit - entry._size;
-  <span class="keyword">var</span> droppedEntries = <span class="keyword">this</span>._enforceLimit(limit);
-
-  <span class="keyword">if</span> (<span class="keyword">this</span>._size &lt;= limit) {
-    <span class="keyword">this</span>.unshift(entry);
-    <span class="keyword">this</span>._size += entry._size;
-  }
-
-  <span class="keyword">return</span> droppedEntries;
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-8">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-8">&#182;</a>
-              </div>
-              <p>The table size limit can be changed externally. In this case, the same eviction algorithm is used</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderTable.prototype.setSizeLimit = <span class="function"><span class="keyword">function</span> <span class="title">setSizeLimit</span><span class="params">(limit)</span> {</span>
-  <span class="keyword">this</span>._limit = limit;
-  <span class="keyword">this</span>._enforceLimit(<span class="keyword">this</span>._limit);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-9">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-9">&#182;</a>
-              </div>
-              <h2 id="-the-static-table-http-tools-ietf-org-html-draft-ietf-httpbis-header-compression-05-appendix-b-"><a href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05#appendix-B">The Static Table</a></h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-10">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-10">&#182;</a>
-              </div>
-              <p>The table is generated with feeding the table from the spec to the following sed command:</p>
-<pre><code>sed -re &quot;s/\s*\| [0-9]+\s*\| ([^ ]*)/  [ &#39;\1&#39;/g&quot; -e &quot;s/\|\s([^ ]*)/, &#39;\1&#39;/g&quot; -e &#39;s/ \|/],/g&#39;</code></pre>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderTable.staticTable  = [
-  [ <span class="string">':authority'</span>                  , <span class="string">''</span>            ],
-  [ <span class="string">':method'</span>                     , <span class="string">'GET'</span>         ],
-  [ <span class="string">':method'</span>                     , <span class="string">'POST'</span>        ],
-  [ <span class="string">':path'</span>                       , <span class="string">'/'</span>           ],
-  [ <span class="string">':path'</span>                       , <span class="string">'/index.html'</span> ],
-  [ <span class="string">':scheme'</span>                     , <span class="string">'http'</span>        ],
-  [ <span class="string">':scheme'</span>                     , <span class="string">'https'</span>       ],
-  [ <span class="string">':status'</span>                     , <span class="string">'200'</span>         ],
-  [ <span class="string">':status'</span>                     , <span class="string">'500'</span>         ],
-  [ <span class="string">':status'</span>                     , <span class="string">'404'</span>         ],
-  [ <span class="string">':status'</span>                     , <span class="string">'403'</span>         ],
-  [ <span class="string">':status'</span>                     , <span class="string">'400'</span>         ],
-  [ <span class="string">':status'</span>                     , <span class="string">'401'</span>         ],
-  [ <span class="string">'accept-charset'</span>              , <span class="string">''</span>            ],
-  [ <span class="string">'accept-encoding'</span>             , <span class="string">''</span>            ],
-  [ <span class="string">'accept-language'</span>             , <span class="string">''</span>            ],
-  [ <span class="string">'accept-ranges'</span>               , <span class="string">''</span>            ],
-  [ <span class="string">'accept'</span>                      , <span class="string">''</span>            ],
-  [ <span class="string">'access-control-allow-origin'</span> , <span class="string">''</span>            ],
-  [ <span class="string">'age'</span>                         , <span class="string">''</span>            ],
-  [ <span class="string">'allow'</span>                       , <span class="string">''</span>            ],
-  [ <span class="string">'authorization'</span>               , <span class="string">''</span>            ],
-  [ <span class="string">'cache-control'</span>               , <span class="string">''</span>            ],
-  [ <span class="string">'content-disposition'</span>         , <span class="string">''</span>            ],
-  [ <span class="string">'content-encoding'</span>            , <span class="string">''</span>            ],
-  [ <span class="string">'content-language'</span>            , <span class="string">''</span>            ],
-  [ <span class="string">'content-length'</span>              , <span class="string">''</span>            ],
-  [ <span class="string">'content-location'</span>            , <span class="string">''</span>            ],
-  [ <span class="string">'content-range'</span>               , <span class="string">''</span>            ],
-  [ <span class="string">'content-type'</span>                , <span class="string">''</span>            ],
-  [ <span class="string">'cookie'</span>                      , <span class="string">''</span>            ],
-  [ <span class="string">'date'</span>                        , <span class="string">''</span>            ],
-  [ <span class="string">'etag'</span>                        , <span class="string">''</span>            ],
-  [ <span class="string">'expect'</span>                      , <span class="string">''</span>            ],
-  [ <span class="string">'expires'</span>                     , <span class="string">''</span>            ],
-  [ <span class="string">'from'</span>                        , <span class="string">''</span>            ],
-  [ <span class="string">'host'</span>                        , <span class="string">''</span>            ],
-  [ <span class="string">'if-match'</span>                    , <span class="string">''</span>            ],
-  [ <span class="string">'if-modified-since'</span>           , <span class="string">''</span>            ],
-  [ <span class="string">'if-none-match'</span>               , <span class="string">''</span>            ],
-  [ <span class="string">'if-range'</span>                    , <span class="string">''</span>            ],
-  [ <span class="string">'if-unmodified-since'</span>         , <span class="string">''</span>            ],
-  [ <span class="string">'last-modified'</span>               , <span class="string">''</span>            ],
-  [ <span class="string">'link'</span>                        , <span class="string">''</span>            ],
-  [ <span class="string">'location'</span>                    , <span class="string">''</span>            ],
-  [ <span class="string">'max-forwards'</span>                , <span class="string">''</span>            ],
-  [ <span class="string">'proxy-authenticate'</span>          , <span class="string">''</span>            ],
-  [ <span class="string">'proxy-authorization'</span>         , <span class="string">''</span>            ],
-  [ <span class="string">'range'</span>                       , <span class="string">''</span>            ],
-  [ <span class="string">'referer'</span>                     , <span class="string">''</span>            ],
-  [ <span class="string">'refresh'</span>                     , <span class="string">''</span>            ],
-  [ <span class="string">'retry-after'</span>                 , <span class="string">''</span>            ],
-  [ <span class="string">'server'</span>                      , <span class="string">''</span>            ],
-  [ <span class="string">'set-cookie'</span>                  , <span class="string">''</span>            ],
-  [ <span class="string">'strict-transport-security'</span>   , <span class="string">''</span>            ],
-  [ <span class="string">'transfer-encoding'</span>           , <span class="string">''</span>            ],
-  [ <span class="string">'user-agent'</span>                  , <span class="string">''</span>            ],
-  [ <span class="string">'vary'</span>                        , <span class="string">''</span>            ],
-  [ <span class="string">'via'</span>                         , <span class="string">''</span>            ],
-  [ <span class="string">'www-authenticate'</span>            , <span class="string">''</span>            ]
-];</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-11">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-11">&#182;</a>
-              </div>
-              <h2 id="the-headersetdecompressor-class">The HeaderSetDecompressor class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-12">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-12">&#182;</a>
-              </div>
-              <p>A <code>HeaderSetDecompressor</code> instance is a transform stream that can be used to <em>decompress a
-single header set</em>. Its input is a stream of binary data chunks and its output is a stream of
-<code>[name, value]</code> pairs.</p>
-<p>Currently, it is not a proper streaming decompressor implementation, since it buffer its input
-until the end os the stream, and then processes the whole header block at once.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>util.inherits(HeaderSetDecompressor, TransformStream);
-<span class="function"><span class="keyword">function</span> <span class="title">HeaderSetDecompressor</span><span class="params">(log, table, huffmanTable)</span> {</span>
-  TransformStream.call(<span class="keyword">this</span>, { objectMode: <span class="literal">true</span> });
-
-  <span class="keyword">this</span>._log = log.child({ component: <span class="string">'compressor'</span> });
-  <span class="keyword">this</span>._table = table;
-  <span class="keyword">this</span>._huffmanTable = huffmanTable;
-  <span class="keyword">this</span>._chunks = [];
-}</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-13">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-13">&#182;</a>
-              </div>
-              <p><code>_transform</code> is the implementation of the <a href="http://nodejs.org/api/stream.html#stream_transform_transform_chunk_encoding_callback">corresponding virtual function</a> of the
-TransformStream class. It collects the data chunks for later processing.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderSetDecompressor.prototype._transform = <span class="function"><span class="keyword">function</span> <span class="title">_transform</span><span class="params">(chunk, encoding, callback)</span> {</span>
-  <span class="keyword">this</span>._chunks.push(chunk);
-  callback();
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-14">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-14">&#182;</a>
-              </div>
-              <p><code>execute(rep)</code> executes the given <a href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05#section-3.1.4">header representation</a>.</p>
-<p>The <em>JavaScript object representation</em> of a header representation:</p>
-<pre><code>{
-  name: String || Integer,  // string literal or index
-  value: String || Integer, // string literal or index
-  index: Boolean            // with or without indexing
-}</code></pre>
-<p><em>Important:</em> to ease the indexing of the header table, indexes start at 0 instead of 1.</p>
-<p>Examples:</p>
-<pre><code>Indexed:
-{ name: 2  , value: 2  , index: false }
-{ name: -1 , value: -1 , index: false } // reference set emptying
-Literal:
-{ name: 2  , value: &#39;X&#39;, index: false } // without indexing
-{ name: 2  , value: &#39;Y&#39;, index: true  } // with indexing
-{ name: &#39;A&#39;, value: &#39;Z&#39;, index: true  } // with indexing, literal name</code></pre>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderSetDecompressor.prototype._execute = <span class="function"><span class="keyword">function</span> <span class="title">_execute</span><span class="params">(rep)</span> {</span>
-  <span class="keyword">this</span>._log.trace({ key: rep.name, value: rep.value, index: rep.index },
-                  <span class="string">'Executing header representation'</span>);
-
-  <span class="keyword">var</span> entry, pair;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-15">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-15">&#182;</a>
-              </div>
-              <ul>
-<li>An <em>indexed representation</em> with an index value of 0 (in our representation, it means -1)
-entails the following actions:<ul>
-<li>The reference set is emptied.</li>
-</ul>
-</li>
-<li>An <em>indexed representation</em> corresponding to an entry <em>present</em> in the reference set
-entails the following actions:<ul>
-<li>The entry is removed from the reference set.</li>
-</ul>
-</li>
-<li>An <em>indexed representation</em> corresponding to an entry <em>not present</em> in the reference set
-entails the following actions:<ul>
-<li>If referencing an element of the static table:<ul>
-<li>The header field corresponding to the referenced entry is emitted</li>
-<li>The referenced static entry is added to the header table</li>
-<li>A reference to this new header table entry is added to the reference set (except if
-this new entry didn&#39;t fit in the header table)</li>
-</ul>
-</li>
-<li>If referencing an element of the header table:<ul>
-<li>The header field corresponding to the referenced entry is emitted</li>
-<li>The referenced header table entry is added to the reference set</li>
-</ul>
-</li>
-</ul>
-</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (<span class="keyword">typeof</span> rep.value === <span class="string">'number'</span>) {
-    <span class="keyword">var</span> index = rep.value;
-    entry = <span class="keyword">this</span>._table[index];
-
-    <span class="keyword">if</span> (index == -<span class="number">1</span>) {
-      <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; <span class="keyword">this</span>._table.length; i++) {
-        <span class="keyword">this</span>._table[i].reference = <span class="literal">false</span>;
-      }
-    }
-
-    <span class="keyword">else</span> <span class="keyword">if</span> (entry.reference) {
-      entry.reference = <span class="literal">false</span>;
-    }
-
-    <span class="keyword">else</span> {
-      pair = entry.slice();
-      <span class="keyword">this</span>.push(pair);
-
-      <span class="keyword">if</span> (index &gt;= <span class="keyword">this</span>._table.length - <span class="keyword">this</span>._table._staticLength) {
-        entry = entryFromPair(pair);
-        <span class="keyword">this</span>._table.add(entry);
-      }
-
-      entry.reference = <span class="literal">true</span>;
-      entry.emitted = <span class="literal">true</span>;
-    }
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-16">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-16">&#182;</a>
-              </div>
-              <ul>
-<li>A <em>literal representation</em> that is <em>not added</em> to the header table entails the following
-action:<ul>
-<li>The header is emitted.</li>
-</ul>
-</li>
-<li>A <em>literal representation</em> that is <em>added</em> to the header table entails the following further
-actions:<ul>
-<li>The header is added to the header table.</li>
-<li>The new entry is added to the reference set.</li>
-</ul>
-</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> {
-    <span class="keyword">if</span> (<span class="keyword">typeof</span> rep.name === <span class="string">'number'</span>) {
-      pair = [<span class="keyword">this</span>._table[rep.name][<span class="number">0</span>], rep.value];
-    } <span class="keyword">else</span> {
-      pair = [rep.name, rep.value];
-    }
-
-    <span class="keyword">if</span> (rep.index) {
-      entry = entryFromPair(pair);
-      entry.reference = <span class="literal">true</span>;
-      entry.emitted = <span class="literal">true</span>;
-      <span class="keyword">this</span>._table.add(entry);
-    }
-
-    <span class="keyword">this</span>.push(pair);
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-17">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-17">&#182;</a>
-              </div>
-              <p><code>_flush</code> is the implementation of the <a href="http://nodejs.org/api/stream.html#stream_transform_flush_callback">corresponding virtual function</a> of the
-TransformStream class. The whole decompressing process is done in <code>_flush</code>. It gets called when
-the input stream is over.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderSetDecompressor.prototype._flush = <span class="function"><span class="keyword">function</span> <span class="title">_flush</span><span class="params">(callback)</span> {</span>
-  <span class="keyword">var</span> buffer = concat(<span class="keyword">this</span>._chunks);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-18">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-18">&#182;</a>
-              </div>
-              <ul>
-<li>processes the header representations</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  buffer.cursor = <span class="number">0</span>;
-  <span class="keyword">while</span> (buffer.cursor &lt; buffer.length) {
-    <span class="keyword">this</span>._execute(HeaderSetDecompressor.header(buffer, <span class="keyword">this</span>._huffmanTable));
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-19">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-19">&#182;</a>
-              </div>
-              <ul>
-<li><a href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05#section-3.2.2">emits the reference set</a></li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">for</span> (<span class="keyword">var</span> index = <span class="number">0</span>; index &lt; <span class="keyword">this</span>._table.length; index++) {
-    <span class="keyword">var</span> entry = <span class="keyword">this</span>._table[index];
-    <span class="keyword">if</span> (entry.reference &amp;&amp; !entry.emitted) {
-      <span class="keyword">this</span>.push(entry.slice());
-    }
-    entry.emitted = <span class="literal">false</span>;
-  }
-
-  callback();
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-20">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-20">&#182;</a>
-              </div>
-              <h2 id="the-headersetcompressor-class">The HeaderSetCompressor class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-21">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-21">&#182;</a>
-              </div>
-              <p>A <code>HeaderSetCompressor</code> instance is a transform stream that can be used to <em>compress a single
-header set</em>. Its input is a stream of <code>[name, value]</code> pairs and its output is a stream of
-binary data chunks.</p>
-<p>It is a real streaming compressor, since it does not wait until the header set is complete.</p>
-<p>The compression algorithm is (intentionally) not specified by the spec. Therefore, the current
-compression algorithm can probably be improved in the future.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>util.inherits(HeaderSetCompressor, TransformStream);
-<span class="function"><span class="keyword">function</span> <span class="title">HeaderSetCompressor</span><span class="params">(log, table, huffmanTable)</span> {</span>
-  TransformStream.call(<span class="keyword">this</span>, { objectMode: <span class="literal">true</span> });
-
-  <span class="keyword">this</span>._log = log.child({ component: <span class="string">'compressor'</span> });
-  <span class="keyword">this</span>._table = table;
-  <span class="keyword">this</span>._huffmanTable = huffmanTable;
-  <span class="keyword">this</span>.push = TransformStream.prototype.push.bind(<span class="keyword">this</span>);
-}
-
-HeaderSetCompressor.prototype.send = <span class="function"><span class="keyword">function</span> <span class="title">send</span><span class="params">(rep)</span> {</span>
-  <span class="keyword">this</span>._log.trace({ key: rep.name, value: rep.value, index: rep.index },
-                  <span class="string">'Emitting header representation'</span>);
-
-  <span class="keyword">if</span> (!rep.chunks) {
-    rep.chunks = HeaderSetCompressor.header(rep, <span class="keyword">this</span>._huffmanTable);
-  }
-  rep.chunks.forEach(<span class="keyword">this</span>.push);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-22">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-22">&#182;</a>
-              </div>
-              <p><code>_transform</code> is the implementation of the <a href="http://nodejs.org/api/stream.html#stream_transform_transform_chunk_encoding_callback">corresponding virtual function</a> of the
-TransformStream class. It processes the input headers one by one:</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderSetCompressor.prototype._transform = <span class="function"><span class="keyword">function</span> <span class="title">_transform</span><span class="params">(pair, encoding, callback)</span> {</span>
-  <span class="keyword">var</span> name = pair[<span class="number">0</span>].toLowerCase();
-  <span class="keyword">var</span> value = pair[<span class="number">1</span>];
-  <span class="keyword">var</span> entry, rep;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-23">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-23">&#182;</a>
-              </div>
-              <ul>
-<li>tries to find full (name, value) or name match in the header table</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">var</span> nameMatch = -<span class="number">1</span>, fullMatch = -<span class="number">1</span>;
-  <span class="keyword">for</span> (<span class="keyword">var</span> droppedIndex = <span class="number">0</span>; droppedIndex &lt; <span class="keyword">this</span>._table.length; droppedIndex++) {
-    entry = <span class="keyword">this</span>._table[droppedIndex];
-    <span class="keyword">if</span> (entry[<span class="number">0</span>] === name) {
-      <span class="keyword">if</span> (entry[<span class="number">1</span>] === value) {
-        fullMatch = droppedIndex;
-        <span class="keyword">break</span>;
-      } <span class="keyword">else</span> <span class="keyword">if</span> (nameMatch === -<span class="number">1</span>) {
-        nameMatch = droppedIndex;
-      }
-    }
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-24">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-24">&#182;</a>
-              </div>
-              <ul>
-<li><p>if there&#39;s full match, it will be an indexed representation (or more than one) depending
-on its presence in the reference, the emitted and the keep set:</p>
-<ul>
-<li><p>If the entry is outside the reference set, then a single indexed representation puts the
-entry into it and emits the header. Note that if the matched entry is in the static table,
-then it has to be added to the header table.</p>
-</li>
-<li><p>If it&#39;s already in the keep set, then 4 indexed representations are needed:</p>
-<ol>
-<li>removes it from the reference set</li>
-<li>puts it back in the reference set and emits the header once</li>
-<li>removes it again</li>
-<li>puts it back and emits it again for the second time</li>
-</ol>
-<p>It won&#39;t be emitted at the end of the decoding process since it&#39;s now in the emitted set.</p>
-</li>
-<li><p>If it&#39;s in the emitted set, then 2 indexed representations are needed:</p>
-<ol>
-<li>removes it from the reference set</li>
-<li>puts it back in the reference set and emits the header once</li>
-</ol>
-</li>
-<li><p>If it&#39;s in the reference set, but outside the keep set and the emitted set, then this
-header is common with the previous header set, and is still untouched. We mark it to keep
-in the reference set (that means don&#39;t remove at the end of the encoding process).</p>
-</li>
-</ul>
-</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (fullMatch !== -<span class="number">1</span>) {
-    rep = { name: fullMatch, value: fullMatch, index: <span class="literal">false</span> };
-
-    <span class="keyword">if</span> (!entry.reference) {
-      <span class="keyword">if</span> (fullMatch &gt;= <span class="keyword">this</span>._table.length - <span class="keyword">this</span>._table._staticLength) {
-        entry = entryFromPair(pair);
-        <span class="keyword">this</span>._table.add(entry);
-      }
-      <span class="keyword">this</span>.send(rep);
-      entry.reference = <span class="literal">true</span>;
-      entry.emitted = <span class="literal">true</span>;
-    }
-
-    <span class="keyword">else</span> <span class="keyword">if</span> (entry.keep) {
-      <span class="keyword">this</span>.send(rep);
-      <span class="keyword">this</span>.send(rep);
-      <span class="keyword">this</span>.send(rep);
-      <span class="keyword">this</span>.send(rep);
-      entry.keep = <span class="literal">false</span>;
-      entry.emitted = <span class="literal">true</span>;
-    }
-
-    <span class="keyword">else</span> <span class="keyword">if</span> (entry.emitted) {
-      <span class="keyword">this</span>.send(rep);
-      <span class="keyword">this</span>.send(rep);
-    }
-
-    <span class="keyword">else</span> {
-      entry.keep = <span class="literal">true</span>;
-    }
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-25">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-25">&#182;</a>
-              </div>
-              <ul>
-<li>otherwise, it will be a literal representation (with a name index if there&#39;s a name match)</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> {
-    entry = entryFromPair(pair);
-    entry.emitted = <span class="literal">true</span>;
-
-    <span class="keyword">var</span> indexing = (entry._size &lt; <span class="keyword">this</span>._table._limit / <span class="number">2</span>);
-
-    <span class="keyword">if</span> (indexing) {
-      entry.reference = <span class="literal">true</span>;
-      <span class="keyword">var</span> droppedEntries = <span class="keyword">this</span>._table.add(entry);
-      <span class="keyword">for</span> (droppedIndex <span class="keyword">in</span> droppedEntries) {
-        <span class="keyword">var</span> dropped = droppedEntries[droppedIndex];
-        <span class="keyword">if</span> (dropped.keep) {
-          rep = { name: droppedIndex, value: droppedIndex, index: <span class="literal">false</span> };
-          <span class="keyword">this</span>.send(rep);
-          <span class="keyword">this</span>.send(rep);
-        }
-      }
-    }
-
-    <span class="keyword">this</span>.send({ name: (nameMatch !== -<span class="number">1</span>) ? nameMatch : name, value: value, index: indexing });
-  }
-
-  callback();
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-26">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-26">&#182;</a>
-              </div>
-              <p><code>_flush</code> is the implementation of the <a href="http://nodejs.org/api/stream.html#stream_transform_flush_callback">corresponding virtual function</a> of the
-TransformStream class. It gets called when there&#39;s no more header to compress. The final step:</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderSetCompressor.prototype._flush = <span class="function"><span class="keyword">function</span> <span class="title">_flush</span><span class="params">(callback)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-27">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-27">&#182;</a>
-              </div>
-              <ul>
-<li>removing entries from the header set that are not marked to be kept or emitted</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">for</span> (<span class="keyword">var</span> index = <span class="number">0</span>; index &lt; <span class="keyword">this</span>._table.length; index++) {
-    <span class="keyword">var</span> entry = <span class="keyword">this</span>._table[index];
-    <span class="keyword">if</span> (entry.reference &amp;&amp; !entry.keep &amp;&amp; !entry.emitted) {
-      <span class="keyword">this</span>.send({ name: index, value: index, index: <span class="literal">false</span> });
-      entry.reference = <span class="literal">false</span>;
-    }
-    entry.keep = <span class="literal">false</span>;
-    entry.emitted = <span class="literal">false</span>;
-  }
-
-  callback();
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-28">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-28">&#182;</a>
-              </div>
-              <h2 id="-detailed-format-http-tools-ietf-org-html-draft-ietf-httpbis-header-compression-05-section-4-"><a href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05#section-4">Detailed Format</a></h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-29">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-29">&#182;</a>
-              </div>
-              <h3 id="integer-representation">Integer representation</h3>
-<p>The algorithm to represent an integer I is as follows:</p>
-<ol>
-<li>If I &lt; 2^N - 1, encode I on N bits</li>
-<li>Else, encode 2^N - 1 on N bits and do the following steps:<ol>
-<li>Set I to (I - (2^N - 1)) and Q to 1</li>
-<li>While Q &gt; 0<ol>
-<li>Compute Q and R, quotient and remainder of I divided by 2^7</li>
-<li>If Q is strictly greater than 0, write one 1 bit; otherwise, write one 0 bit</li>
-<li>Encode R on the next 7 bits</li>
-<li>I = Q</li>
-</ol>
-</li>
-</ol>
-</li>
-</ol>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderSetCompressor.integer = <span class="function"><span class="keyword">function</span> <span class="title">writeInteger</span><span class="params">(I, N)</span> {</span>
-  <span class="keyword">var</span> limit = Math.pow(<span class="number">2</span>,N) - <span class="number">1</span>;
-  <span class="keyword">if</span> (I &lt; limit) {
-    <span class="keyword">return</span> [<span class="keyword">new</span> Buffer([I])];
-  }
-
-  <span class="keyword">var</span> bytes = [];
-  <span class="keyword">if</span> (N !== <span class="number">0</span>) {
-    bytes.push(limit);
-  }
-  I -= limit;
-
-  <span class="keyword">var</span> Q = <span class="number">1</span>, R;
-  <span class="keyword">while</span> (Q &gt; <span class="number">0</span>) {
-    Q = Math.floor(I / <span class="number">128</span>);
-    R = I % <span class="number">128</span>;
-
-    <span class="keyword">if</span> (Q &gt; <span class="number">0</span>) {
-      R += <span class="number">128</span>;
-    }
-    bytes.push(R);
-
-    I = Q;
-  }
-
-  <span class="keyword">return</span> [<span class="keyword">new</span> Buffer(bytes)];
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-30">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-30">&#182;</a>
-              </div>
-              <p>The inverse algorithm:</p>
-<ol>
-<li>Set I to the number coded on the lower N bits of the first byte</li>
-<li>If I is smaller than 2^N - 1 then return I</li>
-<li>Else the number is encoded on more than one byte, so do the following steps:<ol>
-<li>Set M to 0</li>
-<li>While returning with I<ol>
-<li>Let B be the next byte (the first byte if N is 0)</li>
-<li>Read out the lower 7 bits of B and multiply it with 2^M</li>
-<li>Increase I with this number</li>
-<li>Increase M by 7</li>
-<li>Return I if the most significant bit of B is 0</li>
-</ol>
-</li>
-</ol>
-</li>
-</ol>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderSetDecompressor.integer = <span class="function"><span class="keyword">function</span> <span class="title">readInteger</span><span class="params">(buffer, N)</span> {</span>
-  <span class="keyword">var</span> limit = Math.pow(<span class="number">2</span>,N) - <span class="number">1</span>;
-
-  <span class="keyword">var</span> I = buffer[buffer.cursor] &amp; limit;
-  <span class="keyword">if</span> (N !== <span class="number">0</span>) {
-    buffer.cursor += <span class="number">1</span>;
-  }
-
-  <span class="keyword">if</span> (I === limit) {
-    <span class="keyword">var</span> M = <span class="number">0</span>;
-    <span class="keyword">do</span> {
-      I += (buffer[buffer.cursor] &amp; <span class="number">127</span>) &lt;&lt; M;
-      M += <span class="number">7</span>;
-      buffer.cursor += <span class="number">1</span>;
-    } <span class="keyword">while</span> (buffer[buffer.cursor - <span class="number">1</span>] &amp; <span class="number">128</span>);
-  }
-
-  <span class="keyword">return</span> I;
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-31">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-31">&#182;</a>
-              </div>
-              <h3 id="huffman-encoding">Huffman Encoding</h3>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">HuffmanTable</span><span class="params">(table)</span> {</span>
-  <span class="function"><span class="keyword">function</span> <span class="title">createTree</span><span class="params">(codes, position)</span> {</span>
-    <span class="keyword">if</span> (codes.length === <span class="number">1</span>) {
-      <span class="keyword">return</span> [table.indexOf(codes[<span class="number">0</span>])];
-    }
-
-    <span class="keyword">else</span> {
-      position = position || <span class="number">0</span>;
-      <span class="keyword">var</span> zero = [];
-      <span class="keyword">var</span> one = [];
-      <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; codes.length; i++) {
-        <span class="keyword">var</span> string = codes[i];
-        <span class="keyword">if</span> (string[position] === <span class="string">'0'</span>) {
-          zero.push(string);
-        } <span class="keyword">else</span> {
-          one.push(string);
-        }
-      }
-      <span class="keyword">return</span> [createTree(zero, position + <span class="number">1</span>), createTree(one, position + <span class="number">1</span>)];
-    }
-  }
-
-  <span class="keyword">this</span>.tree = createTree(table);
-
-  <span class="keyword">this</span>.codes = table.map(<span class="function"><span class="keyword">function</span><span class="params">(bits)</span> {</span>
-    <span class="keyword">return</span> parseInt(bits, <span class="number">2</span>);
-  });
-  <span class="keyword">this</span>.lengths = table.map(<span class="function"><span class="keyword">function</span><span class="params">(bits)</span> {</span>
-    <span class="keyword">return</span> bits.length;
-  });
-}
-
-HuffmanTable.prototype.encode = <span class="function"><span class="keyword">function</span> <span class="title">encode</span><span class="params">(buffer)</span> {</span>
-  <span class="keyword">var</span> result = [];
-  <span class="keyword">var</span> space = <span class="number">8</span>;
-
-  <span class="function"><span class="keyword">function</span> <span class="title">add</span><span class="params">(data)</span> {</span>
-    <span class="keyword">if</span> (space === <span class="number">8</span>) {
-      result.push(data);
-    } <span class="keyword">else</span> {
-      result[result.length - <span class="number">1</span>] |= data;
-    }
-  }
-
-  <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; buffer.length; i++) {
-    <span class="keyword">var</span> byte = buffer[i];
-    <span class="keyword">var</span> code = <span class="keyword">this</span>.codes[byte];
-    <span class="keyword">var</span> length = <span class="keyword">this</span>.lengths[byte];
-
-    <span class="keyword">while</span> (length !== <span class="number">0</span>) {
-      <span class="keyword">if</span> (space &gt;= length) {
-        add(code &lt;&lt; (space - length));
-        code = <span class="number">0</span>;
-        space -= length;
-        length = <span class="number">0</span>;
-      } <span class="keyword">else</span> {
-        <span class="keyword">var</span> shift = length - space;
-        <span class="keyword">var</span> msb = code &gt;&gt; shift;
-        add(msb);
-        code -= msb &lt;&lt; shift;
-        length -= space;
-        space = <span class="number">0</span>;
-      }
-
-      <span class="keyword">if</span> (space === <span class="number">0</span>) {
-        space = <span class="number">8</span>;
-      }
-    }
-  }
-
-  <span class="keyword">if</span> (space !== <span class="number">8</span>) {
-    add(<span class="keyword">this</span>.codes[<span class="number">256</span>] &gt;&gt; (<span class="keyword">this</span>.lengths[<span class="number">256</span>] - space));
-  }
-
-  <span class="keyword">return</span> <span class="keyword">new</span> Buffer(result);
-}
-
-HuffmanTable.prototype.decode = <span class="function"><span class="keyword">function</span> <span class="title">decode</span><span class="params">(buffer)</span> {</span>
-  <span class="keyword">var</span> result = [];
-  <span class="keyword">var</span> subtree = <span class="keyword">this</span>.tree;
-
-  <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; buffer.length; i++) {
-    <span class="keyword">var</span> byte = buffer[i];
-
-    <span class="keyword">for</span> (<span class="keyword">var</span> j = <span class="number">0</span>; j &lt; <span class="number">8</span>; j++) {
-      <span class="keyword">var</span> bit = (byte &amp; <span class="number">128</span>) ? <span class="number">1</span> : <span class="number">0</span>;
-      byte = byte &lt;&lt; <span class="number">1</span>;
-
-      subtree = subtree[bit];
-      <span class="keyword">if</span> (subtree.length === <span class="number">1</span>) {
-        result.push(subtree[<span class="number">0</span>]);
-        subtree = <span class="keyword">this</span>.tree;
-      }
-    }
-  }
-
-  <span class="keyword">return</span> <span class="keyword">new</span> Buffer(result);
-}</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-32">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-32">&#182;</a>
-              </div>
-              <p>The initializer arrays for the Huffman tables are generated with feeding the tables from the
-spec to this sed command:</p>
-<pre><code>sed -e &quot;s/^.* [|]//g&quot; -e &quot;s/|//g&quot; -e &quot;s/ .*//g&quot; -e &quot;s/^/  &#39;/g&quot; -e &quot;s/$/&#39;,/g&quot;</code></pre>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HuffmanTable.requestHuffmanTable = <span class="keyword">new</span> HuffmanTable([
-  <span class="string">'111111111111111111110111010'</span>,
-  <span class="string">'111111111111111111110111011'</span>,
-  <span class="string">'111111111111111111110111100'</span>,
-  <span class="string">'111111111111111111110111101'</span>,
-  <span class="string">'111111111111111111110111110'</span>,
-  <span class="string">'111111111111111111110111111'</span>,
-  <span class="string">'111111111111111111111000000'</span>,
-  <span class="string">'111111111111111111111000001'</span>,
-  <span class="string">'111111111111111111111000010'</span>,
-  <span class="string">'111111111111111111111000011'</span>,
-  <span class="string">'111111111111111111111000100'</span>,
-  <span class="string">'111111111111111111111000101'</span>,
-  <span class="string">'111111111111111111111000110'</span>,
-  <span class="string">'111111111111111111111000111'</span>,
-  <span class="string">'111111111111111111111001000'</span>,
-  <span class="string">'111111111111111111111001001'</span>,
-  <span class="string">'111111111111111111111001010'</span>,
-  <span class="string">'111111111111111111111001011'</span>,
-  <span class="string">'111111111111111111111001100'</span>,
-  <span class="string">'111111111111111111111001101'</span>,
-  <span class="string">'111111111111111111111001110'</span>,
-  <span class="string">'111111111111111111111001111'</span>,
-  <span class="string">'111111111111111111111010000'</span>,
-  <span class="string">'111111111111111111111010001'</span>,
-  <span class="string">'111111111111111111111010010'</span>,
-  <span class="string">'111111111111111111111010011'</span>,
-  <span class="string">'111111111111111111111010100'</span>,
-  <span class="string">'111111111111111111111010101'</span>,
-  <span class="string">'111111111111111111111010110'</span>,
-  <span class="string">'111111111111111111111010111'</span>,
-  <span class="string">'111111111111111111111011000'</span>,
-  <span class="string">'111111111111111111111011001'</span>,
-  <span class="string">'11101000'</span>,
-  <span class="string">'111111111100'</span>,
-  <span class="string">'11111111111010'</span>,
-  <span class="string">'111111111111100'</span>,
-  <span class="string">'111111111111101'</span>,
-  <span class="string">'100100'</span>,
-  <span class="string">'1101110'</span>,
-  <span class="string">'111111111111110'</span>,
-  <span class="string">'11111111010'</span>,
-  <span class="string">'11111111011'</span>,
-  <span class="string">'1111111010'</span>,
-  <span class="string">'11111111100'</span>,
-  <span class="string">'11101001'</span>,
-  <span class="string">'100101'</span>,
-  <span class="string">'00100'</span>,
-  <span class="string">'0000'</span>,
-  <span class="string">'00101'</span>,
-  <span class="string">'00110'</span>,
-  <span class="string">'00111'</span>,
-  <span class="string">'100110'</span>,
-  <span class="string">'100111'</span>,
-  <span class="string">'101000'</span>,
-  <span class="string">'101001'</span>,
-  <span class="string">'101010'</span>,
-  <span class="string">'101011'</span>,
-  <span class="string">'101100'</span>,
-  <span class="string">'111101100'</span>,
-  <span class="string">'11101010'</span>,
-  <span class="string">'111111111111111110'</span>,
-  <span class="string">'101101'</span>,
-  <span class="string">'11111111111111100'</span>,
-  <span class="string">'111101101'</span>,
-  <span class="string">'11111111111011'</span>,
-  <span class="string">'1101111'</span>,
-  <span class="string">'11101011'</span>,
-  <span class="string">'11101100'</span>,
-  <span class="string">'11101101'</span>,
-  <span class="string">'11101110'</span>,
-  <span class="string">'1110000'</span>,
-  <span class="string">'111101110'</span>,
-  <span class="string">'111101111'</span>,
-  <span class="string">'111110000'</span>,
-  <span class="string">'111110001'</span>,
-  <span class="string">'1111111011'</span>,
-  <span class="string">'111110010'</span>,
-  <span class="string">'11101111'</span>,
-  <span class="string">'111110011'</span>,
-  <span class="string">'111110100'</span>,
-  <span class="string">'111110101'</span>,
-  <span class="string">'111110110'</span>,
-  <span class="string">'111110111'</span>,
-  <span class="string">'11110000'</span>,
-  <span class="string">'11110001'</span>,
-  <span class="string">'111111000'</span>,
-  <span class="string">'111111001'</span>,
-  <span class="string">'111111010'</span>,
-  <span class="string">'111111011'</span>,
-  <span class="string">'111111100'</span>,
-  <span class="string">'1111111100'</span>,
-  <span class="string">'11111111111100'</span>,
-  <span class="string">'111111111111111111111011010'</span>,
-  <span class="string">'1111111111100'</span>,
-  <span class="string">'11111111111101'</span>,
-  <span class="string">'101110'</span>,
-  <span class="string">'1111111111111111110'</span>,
-  <span class="string">'01000'</span>,
-  <span class="string">'101111'</span>,
-  <span class="string">'01001'</span>,
-  <span class="string">'110000'</span>,
-  <span class="string">'0001'</span>,
-  <span class="string">'110001'</span>,
-  <span class="string">'110010'</span>,
-  <span class="string">'110011'</span>,
-  <span class="string">'01010'</span>,
-  <span class="string">'1110001'</span>,
-  <span class="string">'1110010'</span>,
-  <span class="string">'01011'</span>,
-  <span class="string">'110100'</span>,
-  <span class="string">'01100'</span>,
-  <span class="string">'01101'</span>,
-  <span class="string">'01110'</span>,
-  <span class="string">'11110010'</span>,
-  <span class="string">'01111'</span>,
-  <span class="string">'10000'</span>,
-  <span class="string">'10001'</span>,
-  <span class="string">'110101'</span>,
-  <span class="string">'1110011'</span>,
-  <span class="string">'110110'</span>,
-  <span class="string">'11110011'</span>,
-  <span class="string">'11110100'</span>,
-  <span class="string">'11110101'</span>,
-  <span class="string">'11111111111111101'</span>,
-  <span class="string">'11111111101'</span>,
-  <span class="string">'11111111111111110'</span>,
-  <span class="string">'111111111101'</span>,
-  <span class="string">'111111111111111111111011011'</span>,
-  <span class="string">'111111111111111111111011100'</span>,
-  <span class="string">'111111111111111111111011101'</span>,
-  <span class="string">'111111111111111111111011110'</span>,
-  <span class="string">'111111111111111111111011111'</span>,
-  <span class="string">'111111111111111111111100000'</span>,
-  <span class="string">'111111111111111111111100001'</span>,
-  <span class="string">'111111111111111111111100010'</span>,
-  <span class="string">'111111111111111111111100011'</span>,
-  <span class="string">'111111111111111111111100100'</span>,
-  <span class="string">'111111111111111111111100101'</span>,
-  <span class="string">'111111111111111111111100110'</span>,
-  <span class="string">'111111111111111111111100111'</span>,
-  <span class="string">'111111111111111111111101000'</span>,
-  <span class="string">'111111111111111111111101001'</span>,
-  <span class="string">'111111111111111111111101010'</span>,
-  <span class="string">'111111111111111111111101011'</span>,
-  <span class="string">'111111111111111111111101100'</span>,
-  <span class="string">'111111111111111111111101101'</span>,
-  <span class="string">'111111111111111111111101110'</span>,
-  <span class="string">'111111111111111111111101111'</span>,
-  <span class="string">'111111111111111111111110000'</span>,
-  <span class="string">'111111111111111111111110001'</span>,
-  <span class="string">'111111111111111111111110010'</span>,
-  <span class="string">'111111111111111111111110011'</span>,
-  <span class="string">'111111111111111111111110100'</span>,
-  <span class="string">'111111111111111111111110101'</span>,
-  <span class="string">'111111111111111111111110110'</span>,
-  <span class="string">'111111111111111111111110111'</span>,
-  <span class="string">'111111111111111111111111000'</span>,
-  <span class="string">'111111111111111111111111001'</span>,
-  <span class="string">'111111111111111111111111010'</span>,
-  <span class="string">'111111111111111111111111011'</span>,
-  <span class="string">'111111111111111111111111100'</span>,
-  <span class="string">'111111111111111111111111101'</span>,
-  <span class="string">'111111111111111111111111110'</span>,
-  <span class="string">'111111111111111111111111111'</span>,
-  <span class="string">'11111111111111111110000000'</span>,
-  <span class="string">'11111111111111111110000001'</span>,
-  <span class="string">'11111111111111111110000010'</span>,
-  <span class="string">'11111111111111111110000011'</span>,
-  <span class="string">'11111111111111111110000100'</span>,
-  <span class="string">'11111111111111111110000101'</span>,
-  <span class="string">'11111111111111111110000110'</span>,
-  <span class="string">'11111111111111111110000111'</span>,
-  <span class="string">'11111111111111111110001000'</span>,
-  <span class="string">'11111111111111111110001001'</span>,
-  <span class="string">'11111111111111111110001010'</span>,
-  <span class="string">'11111111111111111110001011'</span>,
-  <span class="string">'11111111111111111110001100'</span>,
-  <span class="string">'11111111111111111110001101'</span>,
-  <span class="string">'11111111111111111110001110'</span>,
-  <span class="string">'11111111111111111110001111'</span>,
-  <span class="string">'11111111111111111110010000'</span>,
-  <span class="string">'11111111111111111110010001'</span>,
-  <span class="string">'11111111111111111110010010'</span>,
-  <span class="string">'11111111111111111110010011'</span>,
-  <span class="string">'11111111111111111110010100'</span>,
-  <span class="string">'11111111111111111110010101'</span>,
-  <span class="string">'11111111111111111110010110'</span>,
-  <span class="string">'11111111111111111110010111'</span>,
-  <span class="string">'11111111111111111110011000'</span>,
-  <span class="string">'11111111111111111110011001'</span>,
-  <span class="string">'11111111111111111110011010'</span>,
-  <span class="string">'11111111111111111110011011'</span>,
-  <span class="string">'11111111111111111110011100'</span>,
-  <span class="string">'11111111111111111110011101'</span>,
-  <span class="string">'11111111111111111110011110'</span>,
-  <span class="string">'11111111111111111110011111'</span>,
-  <span class="string">'11111111111111111110100000'</span>,
-  <span class="string">'11111111111111111110100001'</span>,
-  <span class="string">'11111111111111111110100010'</span>,
-  <span class="string">'11111111111111111110100011'</span>,
-  <span class="string">'11111111111111111110100100'</span>,
-  <span class="string">'11111111111111111110100101'</span>,
-  <span class="string">'11111111111111111110100110'</span>,
-  <span class="string">'11111111111111111110100111'</span>,
-  <span class="string">'11111111111111111110101000'</span>,
-  <span class="string">'11111111111111111110101001'</span>,
-  <span class="string">'11111111111111111110101010'</span>,
-  <span class="string">'11111111111111111110101011'</span>,
-  <span class="string">'11111111111111111110101100'</span>,
-  <span class="string">'11111111111111111110101101'</span>,
-  <span class="string">'11111111111111111110101110'</span>,
-  <span class="string">'11111111111111111110101111'</span>,
-  <span class="string">'11111111111111111110110000'</span>,
-  <span class="string">'11111111111111111110110001'</span>,
-  <span class="string">'11111111111111111110110010'</span>,
-  <span class="string">'11111111111111111110110011'</span>,
-  <span class="string">'11111111111111111110110100'</span>,
-  <span class="string">'11111111111111111110110101'</span>,
-  <span class="string">'11111111111111111110110110'</span>,
-  <span class="string">'11111111111111111110110111'</span>,
-  <span class="string">'11111111111111111110111000'</span>,
-  <span class="string">'11111111111111111110111001'</span>,
-  <span class="string">'11111111111111111110111010'</span>,
-  <span class="string">'11111111111111111110111011'</span>,
-  <span class="string">'11111111111111111110111100'</span>,
-  <span class="string">'11111111111111111110111101'</span>,
-  <span class="string">'11111111111111111110111110'</span>,
-  <span class="string">'11111111111111111110111111'</span>,
-  <span class="string">'11111111111111111111000000'</span>,
-  <span class="string">'11111111111111111111000001'</span>,
-  <span class="string">'11111111111111111111000010'</span>,
-  <span class="string">'11111111111111111111000011'</span>,
-  <span class="string">'11111111111111111111000100'</span>,
-  <span class="string">'11111111111111111111000101'</span>,
-  <span class="string">'11111111111111111111000110'</span>,
-  <span class="string">'11111111111111111111000111'</span>,
-  <span class="string">'11111111111111111111001000'</span>,
-  <span class="string">'11111111111111111111001001'</span>,
-  <span class="string">'11111111111111111111001010'</span>,
-  <span class="string">'11111111111111111111001011'</span>,
-  <span class="string">'11111111111111111111001100'</span>,
-  <span class="string">'11111111111111111111001101'</span>,
-  <span class="string">'11111111111111111111001110'</span>,
-  <span class="string">'11111111111111111111001111'</span>,
-  <span class="string">'11111111111111111111010000'</span>,
-  <span class="string">'11111111111111111111010001'</span>,
-  <span class="string">'11111111111111111111010010'</span>,
-  <span class="string">'11111111111111111111010011'</span>,
-  <span class="string">'11111111111111111111010100'</span>,
-  <span class="string">'11111111111111111111010101'</span>,
-  <span class="string">'11111111111111111111010110'</span>,
-  <span class="string">'11111111111111111111010111'</span>,
-  <span class="string">'11111111111111111111011000'</span>,
-  <span class="string">'11111111111111111111011001'</span>,
-  <span class="string">'11111111111111111111011010'</span>,
-  <span class="string">'11111111111111111111011011'</span>,
-  <span class="string">'11111111111111111111011100'</span>
-]);
-
-HuffmanTable.responseHuffmanTable = <span class="keyword">new</span> HuffmanTable([
-  <span class="string">'1111111111111111110111100'</span>,
-  <span class="string">'1111111111111111110111101'</span>,
-  <span class="string">'1111111111111111110111110'</span>,
-  <span class="string">'1111111111111111110111111'</span>,
-  <span class="string">'1111111111111111111000000'</span>,
-  <span class="string">'1111111111111111111000001'</span>,
-  <span class="string">'1111111111111111111000010'</span>,
-  <span class="string">'1111111111111111111000011'</span>,
-  <span class="string">'1111111111111111111000100'</span>,
-  <span class="string">'1111111111111111111000101'</span>,
-  <span class="string">'1111111111111111111000110'</span>,
-  <span class="string">'1111111111111111111000111'</span>,
-  <span class="string">'1111111111111111111001000'</span>,
-  <span class="string">'1111111111111111111001001'</span>,
-  <span class="string">'1111111111111111111001010'</span>,
-  <span class="string">'1111111111111111111001011'</span>,
-  <span class="string">'1111111111111111111001100'</span>,
-  <span class="string">'1111111111111111111001101'</span>,
-  <span class="string">'1111111111111111111001110'</span>,
-  <span class="string">'1111111111111111111001111'</span>,
-  <span class="string">'1111111111111111111010000'</span>,
-  <span class="string">'1111111111111111111010001'</span>,
-  <span class="string">'1111111111111111111010010'</span>,
-  <span class="string">'1111111111111111111010011'</span>,
-  <span class="string">'1111111111111111111010100'</span>,
-  <span class="string">'1111111111111111111010101'</span>,
-  <span class="string">'1111111111111111111010110'</span>,
-  <span class="string">'1111111111111111111010111'</span>,
-  <span class="string">'1111111111111111111011000'</span>,
-  <span class="string">'1111111111111111111011001'</span>,
-  <span class="string">'1111111111111111111011010'</span>,
-  <span class="string">'1111111111111111111011011'</span>,
-  <span class="string">'0000'</span>,
-  <span class="string">'111111111010'</span>,
-  <span class="string">'1101010'</span>,
-  <span class="string">'1111111111010'</span>,
-  <span class="string">'11111111111100'</span>,
-  <span class="string">'111101100'</span>,
-  <span class="string">'1111111000'</span>,
-  <span class="string">'1111111111011'</span>,
-  <span class="string">'111101101'</span>,
-  <span class="string">'111101110'</span>,
-  <span class="string">'111111111011'</span>,
-  <span class="string">'11111111010'</span>,
-  <span class="string">'100010'</span>,
-  <span class="string">'100011'</span>,
-  <span class="string">'100100'</span>,
-  <span class="string">'1101011'</span>,
-  <span class="string">'0001'</span>,
-  <span class="string">'0010'</span>,
-  <span class="string">'0011'</span>,
-  <span class="string">'01000'</span>,
-  <span class="string">'01001'</span>,
-  <span class="string">'01010'</span>,
-  <span class="string">'100101'</span>,
-  <span class="string">'100110'</span>,
-  <span class="string">'01011'</span>,
-  <span class="string">'01100'</span>,
-  <span class="string">'01101'</span>,
-  <span class="string">'111101111'</span>,
-  <span class="string">'1111111111111010'</span>,
-  <span class="string">'1101100'</span>,
-  <span class="string">'1111111111100'</span>,
-  <span class="string">'111111111100'</span>,
-  <span class="string">'1111111111111011'</span>,
-  <span class="string">'1101101'</span>,
-  <span class="string">'11101010'</span>,
-  <span class="string">'11101011'</span>,
-  <span class="string">'11101100'</span>,
-  <span class="string">'11101101'</span>,
-  <span class="string">'11101110'</span>,
-  <span class="string">'100111'</span>,
-  <span class="string">'111110000'</span>,
-  <span class="string">'11101111'</span>,
-  <span class="string">'11110000'</span>,
-  <span class="string">'1111111001'</span>,
-  <span class="string">'111110001'</span>,
-  <span class="string">'101000'</span>,
-  <span class="string">'11110001'</span>,
-  <span class="string">'11110010'</span>,
-  <span class="string">'111110010'</span>,
-  <span class="string">'1111111010'</span>,
-  <span class="string">'111110011'</span>,
-  <span class="string">'101001'</span>,
-  <span class="string">'01110'</span>,
-  <span class="string">'111110100'</span>,
-  <span class="string">'111110101'</span>,
-  <span class="string">'11110011'</span>,
-  <span class="string">'1111111011'</span>,
-  <span class="string">'111110110'</span>,
-  <span class="string">'1111111100'</span>,
-  <span class="string">'11111111011'</span>,
-  <span class="string">'1111111111101'</span>,
-  <span class="string">'11111111100'</span>,
-  <span class="string">'111111111111100'</span>,
-  <span class="string">'111110111'</span>,
-  <span class="string">'11111111111111110'</span>,
-  <span class="string">'01111'</span>,
-  <span class="string">'1101110'</span>,
-  <span class="string">'101010'</span>,
-  <span class="string">'101011'</span>,
-  <span class="string">'10000'</span>,
-  <span class="string">'1101111'</span>,
-  <span class="string">'1110000'</span>,
-  <span class="string">'1110001'</span>,
-  <span class="string">'101100'</span>,
-  <span class="string">'111111000'</span>,
-  <span class="string">'111111001'</span>,
-  <span class="string">'1110010'</span>,
-  <span class="string">'101101'</span>,
-  <span class="string">'101110'</span>,
-  <span class="string">'101111'</span>,
-  <span class="string">'110000'</span>,
-  <span class="string">'111111010'</span>,
-  <span class="string">'110001'</span>,
-  <span class="string">'110010'</span>,
-  <span class="string">'110011'</span>,
-  <span class="string">'110100'</span>,
-  <span class="string">'1110011'</span>,
-  <span class="string">'11110100'</span>,
-  <span class="string">'1110100'</span>,
-  <span class="string">'11110101'</span>,
-  <span class="string">'111111011'</span>,
-  <span class="string">'1111111111111100'</span>,
-  <span class="string">'11111111111101'</span>,
-  <span class="string">'1111111111111101'</span>,
-  <span class="string">'1111111111111110'</span>,
-  <span class="string">'1111111111111111111011100'</span>,
-  <span class="string">'1111111111111111111011101'</span>,
-  <span class="string">'1111111111111111111011110'</span>,
-  <span class="string">'1111111111111111111011111'</span>,
-  <span class="string">'1111111111111111111100000'</span>,
-  <span class="string">'1111111111111111111100001'</span>,
-  <span class="string">'1111111111111111111100010'</span>,
-  <span class="string">'1111111111111111111100011'</span>,
-  <span class="string">'1111111111111111111100100'</span>,
-  <span class="string">'1111111111111111111100101'</span>,
-  <span class="string">'1111111111111111111100110'</span>,
-  <span class="string">'1111111111111111111100111'</span>,
-  <span class="string">'1111111111111111111101000'</span>,
-  <span class="string">'1111111111111111111101001'</span>,
-  <span class="string">'1111111111111111111101010'</span>,
-  <span class="string">'1111111111111111111101011'</span>,
-  <span class="string">'1111111111111111111101100'</span>,
-  <span class="string">'1111111111111111111101101'</span>,
-  <span class="string">'1111111111111111111101110'</span>,
-  <span class="string">'1111111111111111111101111'</span>,
-  <span class="string">'1111111111111111111110000'</span>,
-  <span class="string">'1111111111111111111110001'</span>,
-  <span class="string">'1111111111111111111110010'</span>,
-  <span class="string">'1111111111111111111110011'</span>,
-  <span class="string">'1111111111111111111110100'</span>,
-  <span class="string">'1111111111111111111110101'</span>,
-  <span class="string">'1111111111111111111110110'</span>,
-  <span class="string">'1111111111111111111110111'</span>,
-  <span class="string">'1111111111111111111111000'</span>,
-  <span class="string">'1111111111111111111111001'</span>,
-  <span class="string">'1111111111111111111111010'</span>,
-  <span class="string">'1111111111111111111111011'</span>,
-  <span class="string">'1111111111111111111111100'</span>,
-  <span class="string">'1111111111111111111111101'</span>,
-  <span class="string">'1111111111111111111111110'</span>,
-  <span class="string">'1111111111111111111111111'</span>,
-  <span class="string">'111111111111111110000000'</span>,
-  <span class="string">'111111111111111110000001'</span>,
-  <span class="string">'111111111111111110000010'</span>,
-  <span class="string">'111111111111111110000011'</span>,
-  <span class="string">'111111111111111110000100'</span>,
-  <span class="string">'111111111111111110000101'</span>,
-  <span class="string">'111111111111111110000110'</span>,
-  <span class="string">'111111111111111110000111'</span>,
-  <span class="string">'111111111111111110001000'</span>,
-  <span class="string">'111111111111111110001001'</span>,
-  <span class="string">'111111111111111110001010'</span>,
-  <span class="string">'111111111111111110001011'</span>,
-  <span class="string">'111111111111111110001100'</span>,
-  <span class="string">'111111111111111110001101'</span>,
-  <span class="string">'111111111111111110001110'</span>,
-  <span class="string">'111111111111111110001111'</span>,
-  <span class="string">'111111111111111110010000'</span>,
-  <span class="string">'111111111111111110010001'</span>,
-  <span class="string">'111111111111111110010010'</span>,
-  <span class="string">'111111111111111110010011'</span>,
-  <span class="string">'111111111111111110010100'</span>,
-  <span class="string">'111111111111111110010101'</span>,
-  <span class="string">'111111111111111110010110'</span>,
-  <span class="string">'111111111111111110010111'</span>,
-  <span class="string">'111111111111111110011000'</span>,
-  <span class="string">'111111111111111110011001'</span>,
-  <span class="string">'111111111111111110011010'</span>,
-  <span class="string">'111111111111111110011011'</span>,
-  <span class="string">'111111111111111110011100'</span>,
-  <span class="string">'111111111111111110011101'</span>,
-  <span class="string">'111111111111111110011110'</span>,
-  <span class="string">'111111111111111110011111'</span>,
-  <span class="string">'111111111111111110100000'</span>,
-  <span class="string">'111111111111111110100001'</span>,
-  <span class="string">'111111111111111110100010'</span>,
-  <span class="string">'111111111111111110100011'</span>,
-  <span class="string">'111111111111111110100100'</span>,
-  <span class="string">'111111111111111110100101'</span>,
-  <span class="string">'111111111111111110100110'</span>,
-  <span class="string">'111111111111111110100111'</span>,
-  <span class="string">'111111111111111110101000'</span>,
-  <span class="string">'111111111111111110101001'</span>,
-  <span class="string">'111111111111111110101010'</span>,
-  <span class="string">'111111111111111110101011'</span>,
-  <span class="string">'111111111111111110101100'</span>,
-  <span class="string">'111111111111111110101101'</span>,
-  <span class="string">'111111111111111110101110'</span>,
-  <span class="string">'111111111111111110101111'</span>,
-  <span class="string">'111111111111111110110000'</span>,
-  <span class="string">'111111111111111110110001'</span>,
-  <span class="string">'111111111111111110110010'</span>,
-  <span class="string">'111111111111111110110011'</span>,
-  <span class="string">'111111111111111110110100'</span>,
-  <span class="string">'111111111111111110110101'</span>,
-  <span class="string">'111111111111111110110110'</span>,
-  <span class="string">'111111111111111110110111'</span>,
-  <span class="string">'111111111111111110111000'</span>,
-  <span class="string">'111111111111111110111001'</span>,
-  <span class="string">'111111111111111110111010'</span>,
-  <span class="string">'111111111111111110111011'</span>,
-  <span class="string">'111111111111111110111100'</span>,
-  <span class="string">'111111111111111110111101'</span>,
-  <span class="string">'111111111111111110111110'</span>,
-  <span class="string">'111111111111111110111111'</span>,
-  <span class="string">'111111111111111111000000'</span>,
-  <span class="string">'111111111111111111000001'</span>,
-  <span class="string">'111111111111111111000010'</span>,
-  <span class="string">'111111111111111111000011'</span>,
-  <span class="string">'111111111111111111000100'</span>,
-  <span class="string">'111111111111111111000101'</span>,
-  <span class="string">'111111111111111111000110'</span>,
-  <span class="string">'111111111111111111000111'</span>,
-  <span class="string">'111111111111111111001000'</span>,
-  <span class="string">'111111111111111111001001'</span>,
-  <span class="string">'111111111111111111001010'</span>,
-  <span class="string">'111111111111111111001011'</span>,
-  <span class="string">'111111111111111111001100'</span>,
-  <span class="string">'111111111111111111001101'</span>,
-  <span class="string">'111111111111111111001110'</span>,
-  <span class="string">'111111111111111111001111'</span>,
-  <span class="string">'111111111111111111010000'</span>,
-  <span class="string">'111111111111111111010001'</span>,
-  <span class="string">'111111111111111111010010'</span>,
-  <span class="string">'111111111111111111010011'</span>,
-  <span class="string">'111111111111111111010100'</span>,
-  <span class="string">'111111111111111111010101'</span>,
-  <span class="string">'111111111111111111010110'</span>,
-  <span class="string">'111111111111111111010111'</span>,
-  <span class="string">'111111111111111111011000'</span>,
-  <span class="string">'111111111111111111011001'</span>,
-  <span class="string">'111111111111111111011010'</span>,
-  <span class="string">'111111111111111111011011'</span>,
-  <span class="string">'111111111111111111011100'</span>,
-  <span class="string">'111111111111111111011101'</span>
-]);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-33">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-33">&#182;</a>
-              </div>
-              <h3 id="string-literal-representation">String literal representation</h3>
-<p>Literal <strong>strings</strong> can represent header names or header values. There&#39;s two variant of the
-string encoding:</p>
-<p>String literal with Huffman encoding:</p>
-<pre><code>  0   1   2   3   4   5   6   7
-+---+---+---+---+---+---+---+---+
-| 1 |  Value Length Prefix (7)  |
-+---+---+---+---+---+---+---+---+
-|   Value Length (0-N bytes)    |
-+---+---+---+---+---+---+---+---+
-...
-+---+---+---+---+---+---+---+---+
-| Huffman Encoded Data  |Padding|
-+---+---+---+---+---+---+---+---+</code></pre>
-<p>String literal without Huffman encoding:</p>
-<pre><code>  0   1   2   3   4   5   6   7
-+---+---+---+---+---+---+---+---+
-| 0 |  Value Length Prefix (7)  |
-+---+---+---+---+---+---+---+---+
-|   Value Length (0-N bytes)    |
-+---+---+---+---+---+---+---+---+
-...
-+---+---+---+---+---+---+---+---+
-|  Field Bytes Without Encoding |
-+---+---+---+---+---+---+---+---+</code></pre>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>HeaderSetCompressor.string = <span class="function"><span class="keyword">function</span> <span class="title">writeString</span><span class="params">(str, huffmanTable)</span> {</span>
-  str = <span class="keyword">new</span> Buffer(str, <span class="string">'utf8'</span>);
-
-  <span class="keyword">var</span> huffman = huffmanTable.encode(str);
-  <span class="keyword">if</span> (huffman.length &lt; str.length) {
-    <span class="keyword">var</span> length = HeaderSetCompressor.integer(huffman.length, <span class="number">7</span>)
-    length[<span class="number">0</span>][<span class="number">0</span>] |= <span class="number">128</span>;
-    <span class="keyword">return</span> length.concat(huffman);
-  }
-
-  <span class="keyword">else</span> {
-    length = HeaderSetCompressor.integer(str.length, <span class="number">7</span>)
-    <span class="keyword">return</span> length.concat(str);
-  }
-};
-
-HeaderSetDecompressor.string = <span class="function"><span class="keyword">function</span> <span class="title">readString</span><span class="params">(buffer, huffmanTable)</span> {</span>
-  <span class="keyword">var</span> huffman = buffer[buffer.cursor] &amp; <span class="number">128</span>;
-  <span class="keyword">var</span> length = HeaderSetDecompressor.integer(buffer, <span class="number">7</span>);
-  <span class="keyword">var</span> encoded = buffer.slice(buffer.cursor, buffer.cursor + length);
-  buffer.cursor += length;
-  <span class="keyword">return</span> (huffman ? huffmanTable.decode(encoded) : encoded).toString(<span class="string">'utf8'</span>);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-34">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-34">&#182;</a>
-              </div>
-              <h3 id="header-represenations">Header represenations</h3>
-<p>The JavaScript object representation is described near the
-<code>HeaderSetDecompressor.prototype._execute()</code> method definition.</p>
-<p><strong>All binary header representations</strong> start with a prefix signaling the representation type and
-an index represented using prefix coded integers:</p>
-<pre><code>  0   1   2   3   4   5   6   7
-+---+---+---+---+---+---+---+---+
-| 1 |        Index (7+)         |  Indexed Representation
-+---+---------------------------+
-
-  0   1   2   3   4   5   6   7
-+---+---+---+---+---+---+---+---+
-| 0 | 1 |      Index (6+)       |
-+---+---+---+-------------------+  Literal w/o Indexing
-|       Value Length (8+)       |
-+-------------------------------+  w/ Indexed Name
-| Value String (Length octets)  |
-+-------------------------------+
-
-  0   1   2   3   4   5   6   7
-+---+---+---+---+---+---+---+---+
-| 0 | 1 |           0           |
-+---+---+---+-------------------+
-|       Name Length (8+)        |
-+-------------------------------+  Literal w/o Indexing
-|  Name String (Length octets)  |
-+-------------------------------+  w/ New Name
-|       Value Length (8+)       |
-+-------------------------------+
-| Value String (Length octets)  |
-+-------------------------------+
-
-  0   1   2   3   4   5   6   7
-+---+---+---+---+---+---+---+---+
-| 0 | 0 |      Index (6+)       |
-+---+---+---+-------------------+  Literal w/ Incremental Indexing
-|       Value Length (8+)       |
-+-------------------------------+  w/ Indexed Name
-| Value String (Length octets)  |
-+-------------------------------+
-
-  0   1   2   3   4   5   6   7
-+---+---+---+---+---+---+---+---+
-| 0 | 0 |           0           |
-+---+---+---+-------------------+
-|       Name Length (8+)        |
-+-------------------------------+  Literal w/ Incremental Indexing
-|  Name String (Length octets)  |
-+-------------------------------+  w/ New Name
-|       Value Length (8+)       |
-+-------------------------------+
-| Value String (Length octets)  |
-+-------------------------------+</code></pre>
-<p>The <strong>Indexed Representation</strong> consists of the 1-bit prefix and the Index that is represented as
-a 7-bit prefix coded integer and nothing else.</p>
-<p>After the first bits, <strong>all literal representations</strong> specify the header name, either as a
-pointer to the Header Table (Index) or a string literal. When the string literal representation
-is used, the Index is set to 0 and the string literal starts at the second byte.</p>
-<p>For <strong>all literal representations</strong>, the specification of the header value comes next. It is
-always represented as a string.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> representations = {
-  indexed             : { prefix: <span class="number">7</span>, pattern: <span class="number">0x80</span> },
-  literal             : { prefix: <span class="number">6</span>, pattern: <span class="number">0x40</span> },
-  literalIncremental  : { prefix: <span class="number">6</span>, pattern: <span class="number">0x00</span> }
-};
-
-HeaderSetCompressor.header = <span class="function"><span class="keyword">function</span> <span class="title">writeHeader</span><span class="params">(header, huffmanTable)</span> {</span>
-  <span class="keyword">var</span> representation, buffers = [];
-
-  <span class="keyword">if</span> (<span class="keyword">typeof</span> header.value === <span class="string">'number'</span>) {
-    representation = representations.indexed;
-  } <span class="keyword">else</span> <span class="keyword">if</span> (header.index) {
-    representation = representations.literalIncremental;
-  } <span class="keyword">else</span> {
-    representation = representations.literal;
-  }
-
-  <span class="keyword">if</span> (representation === representations.indexed) {
-    buffers.push(HeaderSetCompressor.integer(header.value + <span class="number">1</span>, representation.prefix));
-  }
-
-  <span class="keyword">else</span> {
-    <span class="keyword">if</span> (<span class="keyword">typeof</span> header.name === <span class="string">'number'</span>) {
-      buffers.push(HeaderSetCompressor.integer(header.name + <span class="number">1</span>, representation.prefix));
-    } <span class="keyword">else</span> {
-      buffers.push(HeaderSetCompressor.integer(<span class="number">0</span>, representation.prefix));
-      buffers.push(HeaderSetCompressor.string(header.name, huffmanTable));
-    }
-    buffers.push(HeaderSetCompressor.string(header.value, huffmanTable));
-  }
-
-  buffers[<span class="number">0</span>][<span class="number">0</span>][<span class="number">0</span>] |= representation.pattern;
-
-  <span class="keyword">return</span> Array.prototype.concat.apply([], buffers); <span class="comment">// array of arrays of buffers -&gt; array of buffers</span>
-};
-
-HeaderSetDecompressor.header = <span class="function"><span class="keyword">function</span> <span class="title">readHeader</span><span class="params">(buffer, huffmanTable)</span> {</span>
-  <span class="keyword">var</span> representation, header = {};
-
-  <span class="keyword">var</span> firstByte = buffer[buffer.cursor];
-  <span class="keyword">if</span> (firstByte &amp; <span class="number">0x80</span>) {
-    representation = representations.indexed;
-  } <span class="keyword">else</span> <span class="keyword">if</span> (firstByte &amp; <span class="number">0x40</span>) {
-    representation = representations.literal;
-  } <span class="keyword">else</span> {
-    representation = representations.literalIncremental;
-  }
-
-  <span class="keyword">if</span> (representation === representations.indexed) {
-    header.value = header.name = HeaderSetDecompressor.integer(buffer, representation.prefix) - <span class="number">1</span>;
-    header.index = <span class="literal">false</span>;
-  }
-
-  <span class="keyword">else</span> {
-    header.name = HeaderSetDecompressor.integer(buffer, representation.prefix) - <span class="number">1</span>;
-    <span class="keyword">if</span> (header.name === -<span class="number">1</span>) {
-      header.name = HeaderSetDecompressor.string(buffer, huffmanTable);
-    }
-    header.value = HeaderSetDecompressor.string(buffer, huffmanTable);
-    header.index = (representation === representations.literalIncremental);
-  }
-
-  <span class="keyword">return</span> header;
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-35">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-35">&#182;</a>
-              </div>
-              <h1 id="integration-with-http-2">Integration with HTTP/2</h1>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-36">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-36">&#182;</a>
-              </div>
-              <p>This section describes the interaction between the compressor/decompressor and the rest of the
-HTTP/2 implementation. The <code>Compressor</code> and the <code>Decompressor</code> makes up a layer between the
-<a href="framer.html">framer</a> and the <a href="connection.html">connection handling component</a>. They let most
-frames pass through, except HEADERS and PUSH_PROMISE frames. They convert the frames between
-these two representations:</p>
-<pre><code>{                                   {
- type: &#39;HEADERS&#39;,                    type: &#39;HEADERS&#39;,
- flags: {},                          flags: {},
- stream: 1,               &lt;===&gt;      stream: 1,
- headers: {                          data: Buffer
-  N1: &#39;V1&#39;,                         }
-  N2: [&#39;V1&#39;, &#39;V2&#39;, ...],
-  // ...
- }
-}</code></pre>
-<p>There are possibly several binary frame that belong to a single non-binary frame.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> MAX_HTTP_PAYLOAD_SIZE = <span class="number">16383</span>;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-37">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-37">&#182;</a>
-              </div>
-              <h2 id="the-compressor-class">The Compressor class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-38">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-38">&#182;</a>
-              </div>
-              <p>The Compressor transform stream is basically stateless.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>util.inherits(Compressor, TransformStream);
-<span class="function"><span class="keyword">function</span> <span class="title">Compressor</span><span class="params">(log, type)</span> {</span>
-  TransformStream.call(<span class="keyword">this</span>, { objectMode: <span class="literal">true</span> });
-
-  <span class="keyword">this</span>._log = log.child({ component: <span class="string">'compressor'</span> });
-
-  assert((type === <span class="string">'REQUEST'</span>) || (type === <span class="string">'RESPONSE'</span>));
-  <span class="keyword">this</span>._huffmanTable = (type === <span class="string">'REQUEST'</span>) ? HuffmanTable.requestHuffmanTable
-                                            : HuffmanTable.responseHuffmanTable;
-  <span class="keyword">this</span>._table = <span class="keyword">new</span> HeaderTable(<span class="keyword">this</span>._log);
-}</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-39">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-39">&#182;</a>
-              </div>
-              <p>Changing the header table size</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Compressor.prototype.setTableSizeLimit = <span class="function"><span class="keyword">function</span> <span class="title">setTableSizeLimit</span><span class="params">(size)</span> {</span>
-  <span class="keyword">this</span>._table.setSizeLimit(size);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-40">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-40">&#182;</a>
-              </div>
-              <p><code>compress</code> takes a header set, and compresses it using a new <code>HeaderSetCompressor</code> stream
-instance. This means that from now on, the advantages of streaming header encoding are lost,
-but the API becomes simpler.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Compressor.prototype.compress = <span class="function"><span class="keyword">function</span> <span class="title">compress</span><span class="params">(headers)</span> {</span>
-  <span class="keyword">var</span> compressor = <span class="keyword">new</span> HeaderSetCompressor(<span class="keyword">this</span>._log, <span class="keyword">this</span>._table, <span class="keyword">this</span>._huffmanTable);
-  <span class="keyword">for</span> (<span class="keyword">var</span> name <span class="keyword">in</span> headers) {
-    <span class="keyword">var</span> value = headers[name];
-    name = String(name).toLowerCase();</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-41">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-41">&#182;</a>
-              </div>
-              <ul>
-<li>To allow for better compression efficiency, the Cookie header field MAY be split into
-separate header fields, each with one or more cookie-pairs.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>    <span class="keyword">if</span> (name == <span class="string">'cookie'</span>) {
-      <span class="keyword">if</span> (!(value <span class="keyword">instanceof</span> Array)) {
-        value = [value]
-      }
-      value = Array.prototype.concat.apply([], value.map(<span class="function"><span class="keyword">function</span><span class="params">(cookie)</span> {</span>
-        <span class="keyword">return</span> String(cookie).split(<span class="string">';'</span>).map(trim)
-      }));
-    }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-42">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-42">&#182;</a>
-              </div>
-              <ul>
-<li>To preserve the order of a comma-separated list, the ordered values for a single header
-field name appearing in different header fields are concatenated into a single value.
-A zero-valued octet (0x0) is used to delimit multiple values.</li>
-<li>Header fields containing multiple values MUST be concatenated into a single value unless
-the ordering of that header field is known to be not significant.</li>
-<li>Currently, only the Cookie header is considered to be order-insensitive.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>    <span class="keyword">if</span> ((value <span class="keyword">instanceof</span> Array) &amp;&amp; (name !== <span class="string">'cookie'</span>)) {
-      value = value.join(<span class="string">'\0'</span>);
-    }
-
-    <span class="keyword">if</span> (value <span class="keyword">instanceof</span> Array) {
-      <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; value.length; i++) {
-        compressor.write([name, String(value[i])]);
-      }
-    } <span class="keyword">else</span> {
-      compressor.write([name, String(value)]);
-    }
-  }
-  compressor.end();
-
-  <span class="keyword">var</span> chunk, chunks = [];
-  <span class="keyword">while</span> (chunk = compressor.read()) {
-    chunks.push(chunk);
-  }
-  <span class="keyword">return</span> concat(chunks);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-43">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-43">&#182;</a>
-              </div>
-              <p>When a <code>frame</code> arrives</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Compressor.prototype._transform = <span class="function"><span class="keyword">function</span> <span class="title">_transform</span><span class="params">(frame, encoding, done)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-44">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-44">&#182;</a>
-              </div>
-              <ul>
-<li>and it is a HEADERS or PUSH_PROMISE frame<ul>
-<li>it generates a header block using the compress method</li>
-<li>cuts the header block into <code>chunks</code> that are not larger than <code>MAX_HTTP_PAYLOAD_SIZE</code></li>
-<li>for each chunk, it pushes out a chunk frame that is identical to the original, except
-the <code>data</code> property which holds the given chunk, the type of the frame which is always
-CONTINUATION except for the first frame, and the END_HEADERS/END_PUSH_STREAM flag that
-marks the last frame and the END_STREAM flag which is always false before the end</li>
-</ul>
-</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (frame.type === <span class="string">'HEADERS'</span> || frame.type === <span class="string">'PUSH_PROMISE'</span>) {
-    <span class="keyword">var</span> buffer = <span class="keyword">this</span>.compress(frame.headers);
-
-    <span class="keyword">var</span> chunks = cut(buffer, MAX_HTTP_PAYLOAD_SIZE);
-
-    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; chunks.length; i++) {
-      <span class="keyword">var</span> chunkFrame;
-      <span class="keyword">var</span> first = (i === <span class="number">0</span>);
-      <span class="keyword">var</span> last = (i === chunks.length - <span class="number">1</span>);
-
-      <span class="keyword">if</span> (first) {
-        chunkFrame = util._extend({}, frame);
-        chunkFrame.flags = util._extend({}, frame.flags);
-        chunkFrame.flags[<span class="string">'END_'</span> + frame.type] = last;
-      } <span class="keyword">else</span> {
-        chunkFrame = {
-          type: <span class="string">'CONTINUATION'</span>,
-          flags: { END_HEADERS: last },
-          stream: frame.stream
-        };
-      }
-      chunkFrame.data = chunks[i];
-
-      <span class="keyword">this</span>.push(chunkFrame);
-    }
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-45">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-45">&#182;</a>
-              </div>
-              <ul>
-<li>otherwise, the frame is forwarded without taking any action</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> {
-    <span class="keyword">this</span>.push(frame);
-  }
-
-  done();
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-46">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-46">&#182;</a>
-              </div>
-              <h2 id="the-decompressor-class">The Decompressor class</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-47">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-47">&#182;</a>
-              </div>
-              <p>The Decompressor is a stateful transform stream, since it has to collect multiple frames first,
-and the decoding comes after unifying the payload of those frames.</p>
-<p>If there&#39;s a frame in progress, <code>this._inProgress</code> is <code>true</code>. The frames are collected in
-<code>this._frames</code>, and the type of the frame and the stream identifier is stored in <code>this._type</code>
-and <code>this._stream</code> respectively.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>util.inherits(Decompressor, TransformStream);
-<span class="function"><span class="keyword">function</span> <span class="title">Decompressor</span><span class="params">(log, type)</span> {</span>
-  TransformStream.call(<span class="keyword">this</span>, { objectMode: <span class="literal">true</span> });
-
-  <span class="keyword">this</span>._log = log.child({ component: <span class="string">'compressor'</span> });
-
-  assert((type === <span class="string">'REQUEST'</span>) || (type === <span class="string">'RESPONSE'</span>));
-  <span class="keyword">this</span>._huffmanTable = (type === <span class="string">'REQUEST'</span>) ? HuffmanTable.requestHuffmanTable
-                                            : HuffmanTable.responseHuffmanTable;
-  <span class="keyword">this</span>._table = <span class="keyword">new</span> HeaderTable(<span class="keyword">this</span>._log);
-
-  <span class="keyword">this</span>._inProgress = <span class="literal">false</span>;
-  <span class="keyword">this</span>._base = <span class="literal">undefined</span>;
-}</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-48">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-48">&#182;</a>
-              </div>
-              <p>Changing the header table size</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Decompressor.prototype.setTableSizeLimit = <span class="function"><span class="keyword">function</span> <span class="title">setTableSizeLimit</span><span class="params">(size)</span> {</span>
-  <span class="keyword">this</span>._table.setSizeLimit(size);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-49">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-49">&#182;</a>
-              </div>
-              <p><code>decompress</code> takes a full header block, and decompresses it using a new <code>HeaderSetDecompressor</code>
-stream instance. This means that from now on, the advantages of streaming header decoding are
-lost, but the API becomes simpler.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Decompressor.prototype.decompress = <span class="function"><span class="keyword">function</span> <span class="title">decompress</span><span class="params">(block)</span> {</span>
-  <span class="keyword">var</span> decompressor = <span class="keyword">new</span> HeaderSetDecompressor(<span class="keyword">this</span>._log, <span class="keyword">this</span>._table, <span class="keyword">this</span>._huffmanTable);
-  decompressor.end(block);
-
-  <span class="keyword">var</span> headers = {};
-  <span class="keyword">var</span> pair;
-  <span class="keyword">while</span> (pair = decompressor.read()) {
-    <span class="keyword">var</span> name = pair[<span class="number">0</span>];</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-50">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-50">&#182;</a>
-              </div>
-              <ul>
-<li>After decompression, header fields that have values containing zero octets (0x0) MUST be
-split into multiple header fields before being processed.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>    <span class="keyword">var</span> values = pair[<span class="number">1</span>].split(<span class="string">'\0'</span>);
-    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; values.length; i++) {
-      <span class="keyword">var</span> value = values[i];
-      <span class="keyword">if</span> (name <span class="keyword">in</span> headers) {
-        <span class="keyword">if</span> (headers[name] <span class="keyword">instanceof</span> Array) {
-          headers[name].push(value);
-        } <span class="keyword">else</span> {
-          headers[name] = [headers[name], value];
-        }
-      } <span class="keyword">else</span> {
-        headers[name] = value;
-      }
-    }
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-51">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-51">&#182;</a>
-              </div>
-              <ul>
-<li>If there are multiple Cookie header fields after decompression, these MUST be concatenated
-into a single octet string using the two octet delimiter of 0x3B, 0x20 (the ASCII
-string &quot;; &quot;).</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> ((<span class="string">'cookie'</span> <span class="keyword">in</span> headers) &amp;&amp; (headers[<span class="string">'cookie'</span>] <span class="keyword">instanceof</span> Array)) {
-    headers[<span class="string">'cookie'</span>] = headers[<span class="string">'cookie'</span>].join(<span class="string">'; '</span>)
-  }
-
-  <span class="keyword">return</span> headers;
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-52">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-52">&#182;</a>
-              </div>
-              <p>When a <code>frame</code> arrives</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Decompressor.prototype._transform = <span class="function"><span class="keyword">function</span> <span class="title">_transform</span><span class="params">(frame, encoding, done)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-53">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-53">&#182;</a>
-              </div>
-              <ul>
-<li>and the collection process is already <code>_inProgress</code>, the frame is simply stored, except if
-it&#39;s an illegal frame</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (<span class="keyword">this</span>._inProgress) {
-    <span class="keyword">if</span> ((frame.type !== <span class="string">'CONTINUATION'</span>) || (frame.stream !== <span class="keyword">this</span>._base.stream)) {
-      <span class="keyword">this</span>._log.error(<span class="string">'A series of HEADER frames were not continuous'</span>);
-      <span class="keyword">this</span>.emit(<span class="string">'error'</span>, <span class="string">'PROTOCOL_ERROR'</span>);
-      <span class="keyword">return</span>;
-    }
-    <span class="keyword">this</span>._frames.push(frame);
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-54">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-54">&#182;</a>
-              </div>
-              <ul>
-<li>and the collection process is not <code>_inProgress</code>, but the new frame&#39;s type is HEADERS or
-PUSH_PROMISE, a new collection process begins</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> <span class="keyword">if</span> ((frame.type === <span class="string">'HEADERS'</span>) || (frame.type === <span class="string">'PUSH_PROMISE'</span>)) {
-    <span class="keyword">this</span>._inProgress = <span class="literal">true</span>;
-    <span class="keyword">this</span>._base = util._extend({}, frame);
-    <span class="keyword">this</span>._frames = [frame];
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-55">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-55">&#182;</a>
-              </div>
-              <ul>
-<li>otherwise, the frame is forwarded without taking any action</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> {
-    <span class="keyword">this</span>.push(frame);
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-56">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-56">&#182;</a>
-              </div>
-              <ul>
-<li>When the frame signals that it&#39;s the last in the series, the header block chunks are
-concatenated, the headers are decompressed, and a new frame gets pushed out with the
-decompressed headers.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (<span class="keyword">this</span>._inProgress &amp;&amp; (frame.flags.END_HEADERS || frame.flags.END_PUSH_PROMISE)) {
-    <span class="keyword">var</span> buffer = concat(<span class="keyword">this</span>._frames.map(<span class="function"><span class="keyword">function</span><span class="params">(frame)</span> {</span>
-      <span class="keyword">return</span> frame.data;
-    }));
-    <span class="keyword">try</span> {
-      <span class="keyword">var</span> headers = <span class="keyword">this</span>.decompress(buffer);
-    } <span class="keyword">catch</span>(error) {
-      <span class="keyword">this</span>._log.error({ err: error }, <span class="string">'Header decompression error'</span>);
-      <span class="keyword">this</span>.emit(<span class="string">'error'</span>, <span class="string">'COMPRESSION_ERROR'</span>);
-      <span class="keyword">return</span>;
-    }
-    <span class="keyword">this</span>.push(util._extend(<span class="keyword">this</span>._base, { headers: headers }));
-    <span class="keyword">this</span>._inProgress = <span class="literal">false</span>;
-  }
-
-  done();
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-57">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-57">&#182;</a>
-              </div>
-              <h1 id="helper-functions">Helper functions</h1>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-58">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-58">&#182;</a>
-              </div>
-              <p>Concatenate an array of buffers into a new buffer</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">concat</span><span class="params">(buffers)</span> {</span>
-  <span class="keyword">var</span> size = <span class="number">0</span>;
-  <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; buffers.length; i++) {
-    size += buffers[i].length;
-  }
-
-  <span class="keyword">var</span> concatenated = <span class="keyword">new</span> Buffer(size);
-  <span class="keyword">for</span> (<span class="keyword">var</span> cursor = <span class="number">0</span>, j = <span class="number">0</span>; j &lt; buffers.length; cursor += buffers[j].length, j++) {
-    buffers[j].copy(concatenated, cursor);
-  }
-
-  <span class="keyword">return</span> concatenated;
-}</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-59">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-59">&#182;</a>
-              </div>
-              <p>Cut <code>buffer</code> into chunks not larger than <code>size</code></p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">cut</span><span class="params">(buffer, size)</span> {</span>
-  <span class="keyword">var</span> chunks = [];
-  <span class="keyword">var</span> cursor = <span class="number">0</span>;
-  <span class="keyword">do</span> {
-    <span class="keyword">var</span> chunkSize = Math.min(size, buffer.length - cursor);
-    chunks.push(buffer.slice(cursor, cursor + chunkSize));
-    cursor += chunkSize;
-  } <span class="keyword">while</span>(cursor &lt; buffer.length);
-  <span class="keyword">return</span> chunks;
-}
-
-<span class="function"><span class="keyword">function</span> <span class="title">trim</span><span class="params">(string)</span> {</span>
-  <span class="keyword">return</span> string.trim()
-}</pre></div></div>
-            
-        </li>
-        
-    </ul>
-  </div>
-</body>
-</html>
deleted file mode 100644
--- a/testing/xpcshell/node-http2/node_modules/http2-protocol/doc/connection.html
+++ /dev/null
@@ -1,1622 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-  <title>connection.js</title>
-  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
-  <link rel="stylesheet" media="all" href="docco.css" />
-</head>
-<body>
-  <div id="container">
-    <div id="background"></div>
-    
-      <ul id="jump_to">
-        <li>
-          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
-          <a class="small" href="javascript:void(0);">+</a>
-          <div id="jump_wrapper">
-          <div id="jump_page">
-            
-              
-              <a class="source" href="compressor.html">
-                compressor.js
-              </a>
-            
-              
-              <a class="source" href="connection.html">
-                connection.js
-              </a>
-            
-              
-              <a class="source" href="endpoint.html">
-                endpoint.js
-              </a>
-            
-              
-              <a class="source" href="flow.html">
-                flow.js
-              </a>
-            
-              
-              <a class="source" href="framer.html">
-                framer.js
-              </a>
-            
-              
-              <a class="source" href="index.html">
-                index.js
-              </a>
-            
-              
-              <a class="source" href="stream.html">
-                stream.js
-              </a>
-            
-          </div>
-        </li>
-      </ul>
-    
-    <ul class="sections">
-        
-          <li id="title">
-              <div class="annotation">
-                  <h1>connection.js</h1>
-              </div>
-          </li>
-        
-        
-        
-        <li id="section-1">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-1">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> assert = require(<span class="string">'assert'</span>);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-2">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-2">&#182;</a>
-              </div>
-              <h1 id="the-connection-class">The Connection class</h1>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-3">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-3">&#182;</a>
-              </div>
-              <p>The Connection class manages HTTP/2 connections. Each instance corresponds to one transport
-stream (TCP stream). It operates by sending and receiving frames and is implemented as a
-<a href="flow.html">Flow</a> subclass.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> Flow = require(<span class="string">'./flow'</span>).Flow;
-
-exports.Connection = Connection;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-4">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-4">&#182;</a>
-              </div>
-              <h2 id="public-api">Public API</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-5">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-5">&#182;</a>
-              </div>
-              <ul>
-<li><p><strong>new Connection(log, firstStreamId, settings)</strong>: create a new Connection</p>
-</li>
-<li><p><strong>Event: &#39;error&#39; (type)</strong>: signals a connection level error made by the other end</p>
-</li>
-<li><p><strong>Event: &#39;peerError&#39; (type)</strong>: signals the receipt of a GOAWAY frame that contains an error
-code other than NO_ERROR</p>
-</li>
-<li><p><strong>Event: &#39;stream&#39; (stream)</strong>: signals that there&#39;s an incoming stream</p>
-</li>
-<li><p><strong>createStream(): stream</strong>: initiate a new stream</p>
-</li>
-<li><p><strong>set(settings, callback)</strong>: change the value of one or more settings according to the
-key-value pairs of <code>settings</code>. The callback is called after the peer acknowledged the changes.</p>
-</li>
-<li><p><strong>ping([callback])</strong>: send a ping and call callback when the answer arrives</p>
-</li>
-<li><p><strong>close([error])</strong>: close the stream with an error code</p>
-</li>
-</ul>
-<h2 id="constructor">Constructor</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-6">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-6">&#182;</a>
-              </div>
-              <p>The main aspects of managing the connection are:</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="function"><span class="keyword">function</span> <span class="title">Connection</span><span class="params">(log, firstStreamId, settings)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-7">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-7">&#182;</a>
-              </div>
-              <ul>
-<li>initializing the base class</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  Flow.call(<span class="keyword">this</span>, <span class="number">0</span>);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-8">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-8">&#182;</a>
-              </div>
-              <ul>
-<li>logging: every method uses the common logger object</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._log = log.child({ component: <span class="string">'connection'</span> });</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-9">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-9">&#182;</a>
-              </div>
-              <ul>
-<li>stream management</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._initializeStreamManagement(firstStreamId);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-10">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-10">&#182;</a>
-              </div>
-              <ul>
-<li>lifecycle management</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._initializeLifecycleManagement();</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-11">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-11">&#182;</a>
-              </div>
-              <ul>
-<li>flow control</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._initializeFlowControl();</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-12">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-12">&#182;</a>
-              </div>
-              <ul>
-<li>settings management</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._initializeSettingsManagement(settings);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-13">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-13">&#182;</a>
-              </div>
-              <ul>
-<li>multiplexing</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._initializeMultiplexing();
-}
-Connection.prototype = Object.create(Flow.prototype, { constructor: { value: Connection } });</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-14">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-14">&#182;</a>
-              </div>
-              <h2 id="overview">Overview</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-15">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-15">&#182;</a>
-              </div>
-              <pre><code>         |    ^             |    ^
-         v    |             v    |
-    +--------------+   +--------------+
-+---|   stream1    |---|   stream2    |----      ....      ---+
-|   | +----------+ |   | +----------+ |                       |
-|   | | stream1. | |   | | stream2. | |                       |
-|   +-| upstream |-+   +-| upstream |-+                       |
-|     +----------+       +----------+                         |
-|       |     ^             |     ^                           |
-|       v     |             v     |                           |
-|       +-----+-------------+-----+--------      ....         |
-|       ^     |             |     |                           |
-|       |     v             |     |                           |
-|   +--------------+        |     |                           |
-|   |   stream0    |        |     |                           |
-|   |  connection  |        |     |                           |
-|   |  management  |     multiplexing                         |
-|   +--------------+     flow control                         |
-|                           |     ^                           |
-|                   _read() |     | _write()                  |
-|                           v     |                           |
-|                +------------+ +-----------+                 |
-|                |output queue| |input queue|                 |
-+----------------+------------+-+-----------+-----------------+
-                            |     ^
-                     read() |     | write()
-                            v     |</code></pre>
-<h2 id="stream-management">Stream management</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-16">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-16">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> Stream  = require(<span class="string">'./stream'</span>).Stream;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-17">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-17">&#182;</a>
-              </div>
-              <p>Initialization:</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._initializeStreamManagement = <span class="function"><span class="keyword">function</span> <span class="title">_initializeStreamManagement</span><span class="params">(firstStreamId)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-18">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-18">&#182;</a>
-              </div>
-              <ul>
-<li>streams are stored in two data structures:<ul>
-<li><code>_streamIds</code> is an id -&gt; stream map of the streams that are allowed to receive frames.</li>
-<li><code>_streamPriorities</code> is a priority -&gt; [stream] map of stream that allowed to send frames.</li>
-</ul>
-</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._streamIds = [];
-  <span class="keyword">this</span>._streamPriorities = [];</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-19">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-19">&#182;</a>
-              </div>
-              <ul>
-<li>The next outbound stream ID and the last inbound stream id</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._nextStreamId = firstStreamId;
-  <span class="keyword">this</span>._lastIncomingStream = <span class="number">0</span>;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-20">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-20">&#182;</a>
-              </div>
-              <ul>
-<li>Calling <code>_writeControlFrame</code> when there&#39;s an incoming stream with 0 as stream ID</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._streamIds[<span class="number">0</span>] = { upstream: { write: <span class="keyword">this</span>._writeControlFrame.bind(<span class="keyword">this</span>) } };</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-21">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-21">&#182;</a>
-              </div>
-              <ul>
-<li>By default, the number of concurrent outbound streams is not limited. The <code>_streamLimit</code> can
-be set by the SETTINGS_MAX_CONCURRENT_STREAMS setting.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._streamSlotsFree = <span class="literal">Infinity</span>;
-  <span class="keyword">this</span>._streamLimit = <span class="literal">Infinity</span>;
-  <span class="keyword">this</span>.on(<span class="string">'RECEIVING_SETTINGS_MAX_CONCURRENT_STREAMS'</span>, <span class="keyword">this</span>._updateStreamLimit);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-22">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-22">&#182;</a>
-              </div>
-              <p><code>_writeControlFrame</code> is called when there&#39;s an incoming frame in the <code>_control</code> stream. It
-broadcasts the message by creating an event on it.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._writeControlFrame = <span class="function"><span class="keyword">function</span> <span class="title">_writeControlFrame</span><span class="params">(frame)</span> {</span>
-  <span class="keyword">if</span> ((frame.type === <span class="string">'SETTINGS'</span>) || (frame.type === <span class="string">'PING'</span>) ||
-      (frame.type === <span class="string">'GOAWAY'</span>) || (frame.type === <span class="string">'WINDOW_UPDATE'</span>)) {
-    <span class="keyword">this</span>._log.debug({ frame: frame }, <span class="string">'Receiving connection level frame'</span>);
-    <span class="keyword">this</span>.emit(frame.type, frame);
-  } <span class="keyword">else</span> {
-    <span class="keyword">this</span>._log.error({ frame: frame }, <span class="string">'Invalid connection level frame'</span>);
-    <span class="keyword">this</span>.emit(<span class="string">'error'</span>, <span class="string">'PROTOCOL_ERROR'</span>);
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-23">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-23">&#182;</a>
-              </div>
-              <p>Methods to manage the stream slot pool:</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._updateStreamLimit = <span class="function"><span class="keyword">function</span> <span class="title">_updateStreamLimit</span><span class="params">(newStreamLimit)</span> {</span>
-  <span class="keyword">var</span> wakeup = (<span class="keyword">this</span>._streamSlotsFree === <span class="number">0</span>) &amp;&amp; (newStreamLimit &gt; <span class="keyword">this</span>._streamLimit);
-  <span class="keyword">this</span>._streamSlotsFree += newStreamLimit - <span class="keyword">this</span>._streamLimit;
-  <span class="keyword">this</span>._streamLimit = newStreamLimit;
-  <span class="keyword">if</span> (wakeup) {
-    <span class="keyword">this</span>.emit(<span class="string">'wakeup'</span>);
-  }
-};
-
-Connection.prototype._changeStreamCount = <span class="function"><span class="keyword">function</span> <span class="title">_changeStreamCount</span><span class="params">(change)</span> {</span>
-  <span class="keyword">if</span> (change) {
-    <span class="keyword">this</span>._log.trace({ free: <span class="keyword">this</span>._streamSlotsFree, change: change },
-                    <span class="string">'Changing active stream count.'</span>);
-    <span class="keyword">var</span> wakeup = (<span class="keyword">this</span>._streamSlotsFree === <span class="number">0</span>) &amp;&amp; (change &lt; <span class="number">0</span>);
-    <span class="keyword">this</span>._streamSlotsFree -= change;
-    <span class="keyword">if</span> (wakeup) {
-      <span class="keyword">this</span>.emit(<span class="string">'wakeup'</span>);
-    }
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-24">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-24">&#182;</a>
-              </div>
-              <p>Creating a new <em>inbound or outbound</em> stream with the given <code>id</code> (which is undefined in case of
-an outbound stream) consists of three steps:</p>
-<ol>
-<li>var stream = new Stream(this._log);</li>
-<li>this._allocateId(stream, id);</li>
-<li>this._allocatePriority(stream);</li>
-</ol>
-<p>Allocating an ID to a stream</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._allocateId = <span class="function"><span class="keyword">function</span> <span class="title">_allocateId</span><span class="params">(stream, id)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-25">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-25">&#182;</a>
-              </div>
-              <ul>
-<li>initiated stream without definite ID</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (id === <span class="literal">undefined</span>) {
-    id = <span class="keyword">this</span>._nextStreamId;
-    <span class="keyword">this</span>._nextStreamId += <span class="number">2</span>;
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-26">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-26">&#182;</a>
-              </div>
-              <ul>
-<li>incoming stream with a legitim ID (larger than any previous and different parity than ours)</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> <span class="keyword">if</span> ((id &gt; <span class="keyword">this</span>._lastIncomingStream) &amp;&amp; ((id - <span class="keyword">this</span>._nextStreamId) % <span class="number">2</span> !== <span class="number">0</span>)) {
-    <span class="keyword">this</span>._lastIncomingStream = id;
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-27">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-27">&#182;</a>
-              </div>
-              <ul>
-<li>incoming stream with invalid ID</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> {
-    <span class="keyword">this</span>._log.error({ stream_id: id, lastIncomingStream: <span class="keyword">this</span>._lastIncomingStream },
-                    <span class="string">'Invalid incoming stream ID.'</span>);
-    <span class="keyword">this</span>.emit(<span class="string">'error'</span>, <span class="string">'PROTOCOL_ERROR'</span>);
-    <span class="keyword">return</span> <span class="literal">undefined</span>;
-  }
-
-  assert(!(id <span class="keyword">in</span> <span class="keyword">this</span>._streamIds));</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-28">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-28">&#182;</a>
-              </div>
-              <ul>
-<li>adding to <code>this._streamIds</code></li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._log.trace({ s: stream, stream_id: id }, <span class="string">'Allocating ID for stream.'</span>);
-  <span class="keyword">this</span>._streamIds[id] = stream;
-  stream.id = id;
-  <span class="keyword">this</span>.emit(<span class="string">'new_stream'</span>, stream, id);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-29">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-29">&#182;</a>
-              </div>
-              <ul>
-<li>handling stream errors as connection errors</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  stream.on(<span class="string">'error'</span>, <span class="keyword">this</span>.emit.bind(<span class="keyword">this</span>, <span class="string">'error'</span>));
-
-  <span class="keyword">return</span> id;
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-30">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-30">&#182;</a>
-              </div>
-              <p>Allocating a priority to a stream, and managing priority changes</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._allocatePriority = <span class="function"><span class="keyword">function</span> <span class="title">_allocatePriority</span><span class="params">(stream)</span> {</span>
-  <span class="keyword">this</span>._log.trace({ s: stream }, <span class="string">'Allocating priority for stream.'</span>);
-  <span class="keyword">this</span>._insert(stream, stream._priority);
-  stream.on(<span class="string">'priority'</span>, <span class="keyword">this</span>._reprioritize.bind(<span class="keyword">this</span>, stream));
-  stream.upstream.on(<span class="string">'readable'</span>, <span class="keyword">this</span>.emit.bind(<span class="keyword">this</span>, <span class="string">'wakeup'</span>));
-  <span class="keyword">this</span>.emit(<span class="string">'wakeup'</span>);
-};
-
-Connection.prototype._insert = <span class="function"><span class="keyword">function</span> <span class="title">_insert</span><span class="params">(stream, priority)</span> {</span>
-  <span class="keyword">if</span> (priority <span class="keyword">in</span> <span class="keyword">this</span>._streamPriorities) {
-    <span class="keyword">this</span>._streamPriorities[priority].push(stream);
-  } <span class="keyword">else</span> {
-    <span class="keyword">this</span>._streamPriorities[priority] = [stream];
-  }
-};
-
-Connection.prototype._reprioritize = <span class="function"><span class="keyword">function</span> <span class="title">_reprioritize</span><span class="params">(stream, priority)</span> {</span>
-  <span class="keyword">var</span> bucket = <span class="keyword">this</span>._streamPriorities[stream._priority];
-  <span class="keyword">var</span> index = bucket.indexOf(stream);
-  assert(index !== -<span class="number">1</span>);
-  bucket.splice(index, <span class="number">1</span>);
-  <span class="keyword">if</span> (bucket.length === <span class="number">0</span>) {
-    <span class="keyword">delete</span> <span class="keyword">this</span>._streamPriorities[stream._priority];
-  }
-
-  <span class="keyword">this</span>._insert(stream, priority);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-31">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-31">&#182;</a>
-              </div>
-              <p>Creating an <em>inbound</em> stream with the given ID. It is called when there&#39;s an incoming frame to
-a previously nonexistent stream.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._createIncomingStream = <span class="function"><span class="keyword">function</span> <span class="title">_createIncomingStream</span><span class="params">(id)</span> {</span>
-  <span class="keyword">this</span>._log.debug({ stream_id: id }, <span class="string">'New incoming stream.'</span>);
-
-  <span class="keyword">var</span> stream = <span class="keyword">new</span> Stream(<span class="keyword">this</span>._log);
-  <span class="keyword">this</span>._allocateId(stream, id);
-  <span class="keyword">this</span>._allocatePriority(stream);
-  <span class="keyword">this</span>.emit(<span class="string">'stream'</span>, stream, id);
-
-  <span class="keyword">return</span> stream;
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-32">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-32">&#182;</a>
-              </div>
-              <p>Creating an <em>outbound</em> stream</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype.createStream = <span class="function"><span class="keyword">function</span> <span class="title">createStream</span><span class="params">()</span> {</span>
-  <span class="keyword">this</span>._log.trace(<span class="string">'Creating new outbound stream.'</span>);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-33">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-33">&#182;</a>
-              </div>
-              <ul>
-<li>Receiving is enabled immediately, and an ID gets assigned to the stream</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">var</span> stream = <span class="keyword">new</span> Stream(<span class="keyword">this</span>._log);
-  <span class="keyword">this</span>._allocatePriority(stream);
-
-  <span class="keyword">return</span> stream;
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-34">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-34">&#182;</a>
-              </div>
-              <h2 id="multiplexing">Multiplexing</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-35">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-35">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._initializeMultiplexing = <span class="function"><span class="keyword">function</span> <span class="title">_initializeMultiplexing</span><span class="params">()</span> {</span>
-  <span class="keyword">this</span>.on(<span class="string">'window_update'</span>, <span class="keyword">this</span>.emit.bind(<span class="keyword">this</span>, <span class="string">'wakeup'</span>));
-  <span class="keyword">this</span>._sendScheduled = <span class="literal">false</span>;
-  <span class="keyword">this</span>._firstFrameReceived = <span class="literal">false</span>;
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-36">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-36">&#182;</a>
-              </div>
-              <p>The <code>_send</code> method is a virtual method of the <a href="flow.html">Flow class</a> that has to be implemented
-by child classes. It reads frames from streams and pushes them to the output buffer.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._send = <span class="function"><span class="keyword">function</span> <span class="title">_send</span><span class="params">(immediate)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-37">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-37">&#182;</a>
-              </div>
-              <ul>
-<li>Do not do anything if the connection is already closed</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (<span class="keyword">this</span>._closed) {
-    <span class="keyword">return</span>;
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-38">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-38">&#182;</a>
-              </div>
-              <ul>
-<li>Collapsing multiple calls in a turn into a single deferred call</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (immediate) {
-    <span class="keyword">this</span>._sendScheduled = <span class="literal">false</span>;
-  } <span class="keyword">else</span> {
-    <span class="keyword">if</span> (!<span class="keyword">this</span>._sendScheduled) {
-      <span class="keyword">this</span>._sendScheduled = <span class="literal">true</span>;
-      setImmediate(<span class="keyword">this</span>._send.bind(<span class="keyword">this</span>, <span class="literal">true</span>));
-    }
-    <span class="keyword">return</span>;
-  }
-
-  <span class="keyword">this</span>._log.trace(<span class="string">'Starting forwarding frames from streams.'</span>);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-39">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-39">&#182;</a>
-              </div>
-              <ul>
-<li>Looping through priority <code>bucket</code>s in priority order.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>priority_loop:
-  <span class="keyword">for</span> (<span class="keyword">var</span> priority <span class="keyword">in</span> <span class="keyword">this</span>._streamPriorities) {
-    <span class="keyword">var</span> bucket = <span class="keyword">this</span>._streamPriorities[priority];
-    <span class="keyword">var</span> nextBucket = [];</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-40">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-40">&#182;</a>
-              </div>
-              <ul>
-<li>Forwarding frames from buckets with round-robin scheduling.<ol>
-<li>pulling out frame</li>
-<li>if there&#39;s no frame, skip this stream</li>
-<li>if forwarding this frame would make <code>streamCount</code> greater than <code>streamLimit</code>, skip
-this stream</li>
-<li>adding stream to the bucket of the next round</li>
-<li>assigning an ID to the frame (allocating an ID to the stream if there isn&#39;t already)</li>
-<li>if forwarding a PUSH_PROMISE, allocate ID to the promised stream</li>
-<li>forwarding the frame, changing <code>streamCount</code> as appropriate</li>
-<li>stepping to the next stream if there&#39;s still more frame needed in the output buffer</li>
-<li>switching to the bucket of the next round</li>
-</ol>
-</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>    <span class="keyword">while</span> (bucket.length &gt; <span class="number">0</span>) {
-      <span class="keyword">for</span> (<span class="keyword">var</span> index = <span class="number">0</span>; index &lt; bucket.length; index++) {
-        <span class="keyword">var</span> stream = bucket[index];
-        <span class="keyword">var</span> frame = stream.upstream.read((<span class="keyword">this</span>._window &gt; <span class="number">0</span>) ? <span class="keyword">this</span>._window : -<span class="number">1</span>);
-
-        <span class="keyword">if</span> (!frame) {
-          <span class="keyword">continue</span>;
-        } <span class="keyword">else</span> <span class="keyword">if</span> (frame.count_change &gt; <span class="keyword">this</span>._streamSlotsFree) {
-          stream.upstream.unshift(frame);
-          <span class="keyword">continue</span>;
-        }
-
-        nextBucket.push(stream);
-
-        <span class="keyword">if</span> (frame.stream === <span class="literal">undefined</span>) {
-          frame.stream = stream.id || <span class="keyword">this</span>._allocateId(stream);
-        }
-
-        <span class="keyword">if</span> (frame.type === <span class="string">'PUSH_PROMISE'</span>) {
-          <span class="keyword">this</span>._allocatePriority(frame.promised_stream);
-          frame.promised_stream = <span class="keyword">this</span>._allocateId(frame.promised_stream);
-        }
-
-        <span class="keyword">this</span>._log.trace({ s: stream, frame: frame }, <span class="string">'Forwarding outgoing frame'</span>);
-        <span class="keyword">var</span> moreNeeded = <span class="keyword">this</span>.push(frame);
-        <span class="keyword">this</span>._changeStreamCount(frame.count_change);
-
-        assert(moreNeeded !== <span class="literal">null</span>); <span class="comment">// The frame shouldn't be unforwarded</span>
-        <span class="keyword">if</span> (moreNeeded === <span class="literal">false</span>) {
-          <span class="keyword">break</span> priority_loop;
-        }
-      }
-
-      bucket = nextBucket;
-      nextBucket = [];
-    }
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-41">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-41">&#182;</a>
-              </div>
-              <ul>
-<li>if we couldn&#39;t forward any frame, then sleep until window update, or some other wakeup event</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (moreNeeded === <span class="literal">undefined</span>) {
-    <span class="keyword">this</span>.once(<span class="string">'wakeup'</span>, <span class="keyword">this</span>._send.bind(<span class="keyword">this</span>));
-  }
-
-  <span class="keyword">this</span>._log.trace({ moreNeeded: moreNeeded }, <span class="string">'Stopping forwarding frames from streams.'</span>);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-42">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-42">&#182;</a>
-              </div>
-              <p>The <code>_receive</code> method is another virtual method of the <a href="flow.html">Flow class</a> that has to be
-implemented by child classes. It forwards the given frame to the appropriate stream:</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._receive = <span class="function"><span class="keyword">function</span> <span class="title">_receive</span><span class="params">(frame, done)</span> {</span>
-  <span class="keyword">this</span>._log.trace({ frame: frame }, <span class="string">'Forwarding incoming frame'</span>);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-43">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-43">&#182;</a>
-              </div>
-              <ul>
-<li>first frame needs to be checked by the <code>_onFirstFrameReceived</code> method</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (!<span class="keyword">this</span>._firstFrameReceived) {
-    <span class="keyword">this</span>._firstFrameReceived = <span class="literal">true</span>;
-    <span class="keyword">this</span>._onFirstFrameReceived(frame);
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-44">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-44">&#182;</a>
-              </div>
-              <ul>
-<li>gets the appropriate stream from the stream registry</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">var</span> stream = <span class="keyword">this</span>._streamIds[frame.stream];</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-45">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-45">&#182;</a>
-              </div>
-              <ul>
-<li>or creates one if it&#39;s not in <code>this.streams</code></li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (!stream) {
-    stream = <span class="keyword">this</span>._createIncomingStream(frame.stream);
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-46">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-46">&#182;</a>
-              </div>
-              <ul>
-<li>in case of PUSH_PROMISE, replaces the promised stream id with a new incoming stream</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (frame.type === <span class="string">'PUSH_PROMISE'</span>) {
-    frame.promised_stream = <span class="keyword">this</span>._createIncomingStream(frame.promised_stream);
-  }
-
-  frame.count_change = <span class="keyword">this</span>._changeStreamCount.bind(<span class="keyword">this</span>);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-47">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-47">&#182;</a>
-              </div>
-              <ul>
-<li>and writes it to the <code>stream</code>&#39;s <code>upstream</code></li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  stream.upstream.write(frame);
-
-  done();
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-48">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-48">&#182;</a>
-              </div>
-              <h2 id="settings-management">Settings management</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-49">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-49">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> defaultSettings = {
-  SETTINGS_FLOW_CONTROL_OPTIONS: <span class="literal">true</span>
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-50">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-50">&#182;</a>
-              </div>
-              <p>Settings management initialization:</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._initializeSettingsManagement = <span class="function"><span class="keyword">function</span> <span class="title">_initializeSettingsManagement</span><span class="params">(settings)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-51">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-51">&#182;</a>
-              </div>
-              <ul>
-<li>Setting up the callback queue for setting acknowledgements</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._settingsAckCallbacks = [];</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-52">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-52">&#182;</a>
-              </div>
-              <ul>
-<li>Sending the initial settings.</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._log.debug({ settings: settings },
-                  <span class="string">'Sending the first SETTINGS frame as part of the connection header.'</span>);
-  <span class="keyword">this</span>.set(settings || defaultSettings);</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-53">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-53">&#182;</a>
-              </div>
-              <ul>
-<li>Forwarding SETTINGS frames to the <code>_receiveSettings</code> method</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>.on(<span class="string">'SETTINGS'</span>, <span class="keyword">this</span>._receiveSettings);
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-54">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-54">&#182;</a>
-              </div>
-              <ul>
-<li>Checking that the first frame the other endpoint sends is SETTINGS</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._onFirstFrameReceived = <span class="function"><span class="keyword">function</span> <span class="title">_onFirstFrameReceived</span><span class="params">(frame)</span> {</span>
-  <span class="keyword">if</span> ((frame.stream === <span class="number">0</span>) &amp;&amp; (frame.type === <span class="string">'SETTINGS'</span>)) {
-    <span class="keyword">this</span>._log.debug(<span class="string">'Receiving the first SETTINGS frame as part of the connection header.'</span>);
-  } <span class="keyword">else</span> {
-    <span class="keyword">this</span>._log.fatal({ frame: frame }, <span class="string">'Invalid connection header: first frame is not SETTINGS.'</span>);
-    <span class="keyword">this</span>.emit(<span class="string">'error'</span>);
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-55">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-55">&#182;</a>
-              </div>
-              <p>Handling of incoming SETTINGS frames.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._receiveSettings = <span class="function"><span class="keyword">function</span> <span class="title">_receiveSettings</span><span class="params">(frame)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-56">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-56">&#182;</a>
-              </div>
-              <ul>
-<li>If it&#39;s an ACK, call the appropriate callback</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">if</span> (frame.flags.ACK) {
-    <span class="keyword">var</span> callback = <span class="keyword">this</span>._settingsAckCallbacks.shift();
-    <span class="keyword">if</span> (callback) {
-      callback();
-    }
-  }</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-57">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-57">&#182;</a>
-              </div>
-              <ul>
-<li>If it&#39;s a setting change request, then send an ACK and change the appropriate settings</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">else</span> {
-    <span class="keyword">if</span> (!<span class="keyword">this</span>._closed) {
-      <span class="keyword">this</span>.push({
-        type: <span class="string">'SETTINGS'</span>,
-        flags: { ACK: <span class="literal">true</span> },
-        stream: <span class="number">0</span>,
-        settings: {}
-      });
-    }
-    <span class="keyword">for</span> (<span class="keyword">var</span> name <span class="keyword">in</span> frame.settings) {
-      <span class="keyword">this</span>.emit(<span class="string">'RECEIVING_'</span> + name, frame.settings[name]);
-    }
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-58">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-58">&#182;</a>
-              </div>
-              <p>Changing one or more settings value and sending out a SETTINGS frame</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype.set = <span class="function"><span class="keyword">function</span> <span class="title">set</span><span class="params">(settings, callback)</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-59">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-59">&#182;</a>
-              </div>
-              <ul>
-<li>Calling the callback and emitting event when the change is acknowledges</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  callback = callback || <span class="function"><span class="keyword">function</span> <span class="title">noop</span><span class="params">()</span> {</span>};
-  <span class="keyword">var</span> self = <span class="keyword">this</span>;
-  <span class="keyword">this</span>._settingsAckCallbacks.push(<span class="function"><span class="keyword">function</span><span class="params">()</span> {</span>
-    <span class="keyword">for</span> (<span class="keyword">var</span> name <span class="keyword">in</span> settings) {
-      self.emit(<span class="string">'ACKNOWLEDGED_'</span> + name, settings[name]);
-    }
-    callback();
-  });</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-60">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-60">&#182;</a>
-              </div>
-              <ul>
-<li>Sending out the SETTINGS frame</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>.push({
-    type: <span class="string">'SETTINGS'</span>,
-    flags: { ACK: <span class="literal">false</span> },
-    stream: <span class="number">0</span>,
-    settings: settings
-  });
-  <span class="keyword">for</span> (<span class="keyword">var</span> name <span class="keyword">in</span> settings) {
-    <span class="keyword">this</span>.emit(<span class="string">'SENDING_'</span> + name, settings[name]);
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-61">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-61">&#182;</a>
-              </div>
-              <h2 id="lifecycle-management">Lifecycle management</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-62">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-62">&#182;</a>
-              </div>
-              <p>The main responsibilities of lifecycle management code:</p>
-<ul>
-<li>keeping the connection alive by<ul>
-<li>sending PINGs when the connection is idle</li>
-<li>answering PINGs</li>
-</ul>
-</li>
-<li>ending the connection</li>
-</ul>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._initializeLifecycleManagement = <span class="function"><span class="keyword">function</span> <span class="title">_initializeLifecycleManagement</span><span class="params">()</span> {</span>
-  <span class="keyword">this</span>._pings = {};
-  <span class="keyword">this</span>.on(<span class="string">'PING'</span>, <span class="keyword">this</span>._receivePing);
-  <span class="keyword">this</span>.on(<span class="string">'GOAWAY'</span>, <span class="keyword">this</span>._receiveGoaway);
-  <span class="keyword">this</span>._closed = <span class="literal">false</span>;
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-63">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-63">&#182;</a>
-              </div>
-              <p>Generating a string of length 16 with random hexadecimal digits</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._generatePingId = <span class="function"><span class="keyword">function</span> <span class="title">_generatePingId</span><span class="params">()</span> {</span>
-  <span class="keyword">do</span> {
-    <span class="keyword">var</span> id = <span class="string">''</span>;
-    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; <span class="number">16</span>; i++) {
-      id += Math.floor(Math.random()*<span class="number">16</span>).toString(<span class="number">16</span>);
-    }
-  } <span class="keyword">while</span>(id <span class="keyword">in</span> <span class="keyword">this</span>._pings);
-  <span class="keyword">return</span> id;
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-64">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-64">&#182;</a>
-              </div>
-              <p>Sending a ping and calling <code>callback</code> when the answer arrives</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype.ping = <span class="function"><span class="keyword">function</span> <span class="title">ping</span><span class="params">(callback)</span> {</span>
-  <span class="keyword">var</span> id = <span class="keyword">this</span>._generatePingId();
-  <span class="keyword">var</span> data = <span class="keyword">new</span> Buffer(id, <span class="string">'hex'</span>);
-  <span class="keyword">this</span>._pings[id] = callback;
-
-  <span class="keyword">this</span>._log.debug({ data: data }, <span class="string">'Sending PING.'</span>);
-  <span class="keyword">this</span>.push({
-    type: <span class="string">'PING'</span>,
-    flags: {
-      ACK: <span class="literal">false</span>
-    },
-    stream: <span class="number">0</span>,
-    data: data
-  });
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-65">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-65">&#182;</a>
-              </div>
-              <p>Answering pings</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._receivePing = <span class="function"><span class="keyword">function</span> <span class="title">_receivePing</span><span class="params">(frame)</span> {</span>
-  <span class="keyword">if</span> (frame.flags.ACK) {
-    <span class="keyword">var</span> id = frame.data.toString(<span class="string">'hex'</span>);
-    <span class="keyword">if</span> (id <span class="keyword">in</span> <span class="keyword">this</span>._pings) {
-      <span class="keyword">this</span>._log.debug({ data: frame.data }, <span class="string">'Receiving answer for a PING.'</span>);
-      <span class="keyword">var</span> callback = <span class="keyword">this</span>._pings[id];
-      <span class="keyword">if</span> (callback) {
-        callback();
-      }
-      <span class="keyword">delete</span> <span class="keyword">this</span>._pings[id];
-    } <span class="keyword">else</span> {
-      <span class="keyword">this</span>._log.warn({ data: frame.data }, <span class="string">'Unsolicited PING answer.'</span>);
-    }
-
-  } <span class="keyword">else</span> {
-    <span class="keyword">this</span>._log.debug({ data: frame.data }, <span class="string">'Answering PING.'</span>);
-    <span class="keyword">this</span>.push({
-      type: <span class="string">'PING'</span>,
-      flags: {
-        ACK: <span class="literal">true</span>
-      },
-      stream: <span class="number">0</span>,
-      data: frame.data
-    });
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-66">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-66">&#182;</a>
-              </div>
-              <p>Terminating the connection</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype.close = <span class="function"><span class="keyword">function</span> <span class="title">close</span><span class="params">(error)</span> {</span>
-  <span class="keyword">if</span> (<span class="keyword">this</span>._closed) {
-    <span class="keyword">this</span>._log.warn(<span class="string">'Trying to close an already closed connection'</span>);
-    <span class="keyword">return</span>;
-  }
-
-  <span class="keyword">this</span>._log.debug({ error: error }, <span class="string">'Closing the connection'</span>);
-  <span class="keyword">this</span>.push({
-    type: <span class="string">'GOAWAY'</span>,
-    flags: {},
-    stream: <span class="number">0</span>,
-    last_stream: <span class="keyword">this</span>._lastIncomingStream,
-    error: error || <span class="string">'NO_ERROR'</span>
-  });
-  <span class="keyword">this</span>.push(<span class="literal">null</span>);
-  <span class="keyword">this</span>._closed = <span class="literal">true</span>;
-};
-
-Connection.prototype._receiveGoaway = <span class="function"><span class="keyword">function</span> <span class="title">_receiveGoaway</span><span class="params">(frame)</span> {</span>
-  <span class="keyword">this</span>._log.debug({ error: frame.error }, <span class="string">'Other end closed the connection'</span>);
-  <span class="keyword">this</span>.push(<span class="literal">null</span>);
-  <span class="keyword">this</span>._closed = <span class="literal">true</span>;
-  <span class="keyword">if</span> (frame.error !== <span class="string">'NO_ERROR'</span>) {
-    <span class="keyword">this</span>.emit(<span class="string">'peerError'</span>, frame.error);
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-67">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-67">&#182;</a>
-              </div>
-              <h2 id="flow-control">Flow control</h2>
-
-            </div>
-            
-        </li>
-        
-        
-        <li id="section-68">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-68">&#182;</a>
-              </div>
-              
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._initializeFlowControl = <span class="function"><span class="keyword">function</span> <span class="title">_initializeFlowControl</span><span class="params">()</span> {</span></pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-69">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-69">&#182;</a>
-              </div>
-              <p>Handling of initial window size of individual streams.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>  <span class="keyword">this</span>._initialStreamWindowSize = INITIAL_STREAM_WINDOW_SIZE;
-  <span class="keyword">this</span>.on(<span class="string">'new_stream'</span>, <span class="function"><span class="keyword">function</span><span class="params">(stream)</span> {</span>
-    stream.upstream.setInitialWindow(<span class="keyword">this</span>._initialStreamWindowSize);
-    <span class="keyword">if</span> (<span class="keyword">this</span>._remoteFlowControlDisabled) {
-      stream.upstream.disableRemoteFlowControl();
-    }
-  });
-  <span class="keyword">this</span>.on(<span class="string">'RECEIVING_SETTINGS_INITIAL_WINDOW_SIZE'</span>, <span class="keyword">this</span>._setInitialStreamWindowSize);
-  <span class="keyword">this</span>.on(<span class="string">'RECEIVING_SETTINGS_FLOW_CONTROL_OPTIONS'</span>, <span class="keyword">this</span>._setLocalFlowControl);
-  <span class="keyword">this</span>.on(<span class="string">'SENDING_SETTINGS_FLOW_CONTROL_OPTIONS'</span>, <span class="keyword">this</span>._setRemoteFlowControl);
-  <span class="keyword">this</span>._streamIds[<span class="number">0</span>].upstream.setInitialWindow = <span class="function"><span class="keyword">function</span> <span class="title">noop</span><span class="params">()</span> {</span>};
-  <span class="keyword">this</span>._streamIds[<span class="number">0</span>].upstream.disableRemoteFlowControl = <span class="function"><span class="keyword">function</span> <span class="title">noop</span><span class="params">()</span> {</span>};
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-70">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-70">&#182;</a>
-              </div>
-              <p>The initial connection flow control window is 65535 bytes.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre><span class="keyword">var</span> INITIAL_STREAM_WINDOW_SIZE = <span class="number">65535</span>;</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-71">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-71">&#182;</a>
-              </div>
-              <p>A SETTINGS frame can alter the initial flow control window size for all current streams. When the
-value of SETTINGS_INITIAL_WINDOW_SIZE changes, a receiver MUST adjust the window size of all
-stream by calling the <code>setInitialStreamWindowSize</code> method. The window size has to be modified by
-the difference between the new value and the old value.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._setInitialStreamWindowSize = <span class="function"><span class="keyword">function</span> <span class="title">_setInitialStreamWindowSize</span><span class="params">(size)</span> {</span>
-  <span class="keyword">if</span> ((<span class="keyword">this</span>._initialStreamWindowSize === <span class="literal">Infinity</span>) &amp;&amp; (size !== <span class="literal">Infinity</span>)) {
-    <span class="keyword">this</span>._log.error(<span class="string">'Trying to manipulate initial flow control window size after flow control was turned off.'</span>);
-    <span class="keyword">this</span>.emit(<span class="string">'error'</span>, <span class="string">'FLOW_CONTROL_ERROR'</span>);
-  } <span class="keyword">else</span> {
-    <span class="keyword">this</span>._log.debug({ size: size }, <span class="string">'Changing stream initial window size.'</span>);
-    <span class="keyword">this</span>._initialStreamWindowSize = size;
-    <span class="keyword">this</span>._streamIds.forEach(<span class="function"><span class="keyword">function</span><span class="params">(stream)</span> {</span>
-      stream.upstream.setInitialWindow(size);
-    });
-  }
-};</pre></div></div>
-            
-        </li>
-        
-        
-        <li id="section-72">
-            <div class="annotation">
-              
-              <div class="pilwrap ">
-                <a class="pilcrow" href="#section-72">&#182;</a>
-              </div>
-              <p><code>_setStreamFlowControl()</code> may be used to disable/enable flow control. In practice, it is just
-for turning off flow control since it can not be turned on.</p>
-
-            </div>
-            
-            <div class="content"><div class='highlight'><pre>Connection.prototype._setLocalFlowControl = <span class="function"><span class="keyword">function</span> <span class="title">_setLocalFlowControl</span><span class="params">(disable)</span> {</span>
-  <span class="keyword">if</span> (disable) {
-    <span class="keyword">this</span>._increaseWindow(<span class="literal">Infinity</span>);
-    <span class="keyword">this</span>._setInitialStreamWindowSize(<span class="literal">Infinity</span>);
-  } <span class="keyword">else</span> <span class="keyword">if</span> (<span class="keyword">this</span>._initialStreamWindowSize === <span class="literal">Infinity</span>) {
-    <span class="keyword">this</span>._log.error(<span class="string">'Trying to re-enable flow control after it was turned off.'</span>);
-    <span class="keyword">this</span>.emit(<span class="string">'error'</span>, <span class="string">'FLOW_CONTROL_ERROR'</span>);
-  }
-};
-
-Connection.prototype._setRemoteFlowControl = <span class="function"><span class="keyword">function</span> <span class="title">_setRemoteFlowControl</span><span class="params">(disable)</span> {</span>
-  <span class="keyword">if</span> (disable) {
-    <span class="keyword">this</span>.disableRemoteFlowControl();
-    <span class="keyword">this</span>._streamIds.forEach(<span class="function"><span class="keyword">function</span><span class="params">(stream)</span> {</span>
-      stream.upstream.disableRemoteFlowControl();
-    });
-  } <span class="keyword">else</span> <span class="keyword">if</span> (<span class="keyword">this</span>._remoteFlowControlDisabled) {
-    <span class="keyword">this</span>._log.error(<span class="string">'Trying to re-enable flow control after it was turned off.'</span>);
-    <span class="keyword">throw</span> <span class="keyword">new</span> Error(<span class="string">'Trying to re-enable flow control after it was turned off.'</span>);
-  }
-};</pre></div></div>
-            
-        </li>
-        
-    </ul>
-  </div>
-</body>
-</html>
deleted file mode 100644
--- a/testing/xpcshell/node-http2/node_modules/http2-protocol/doc/docco.css
+++ /dev/null
@@ -1,511 +0,0 @@
-/*-------------- node-http2 customizations --------------------*/
-
-ul.sections > li > div.annotation {
-    min-width: 35em !important;
-    max-width: 35em !important;
-}
-
-#background {
-    width: 35em !important;
-}
-
-/*--------------------- Typography ----------------------------*/
-
-@font-face {
-    font-family: 'aller-light';
-    src: url('public/fonts/aller-light.eot');
-    src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'),
-         url('public/fonts/aller-light.woff') format('woff'),
-         url('public/fonts/aller-light.ttf') format('truetype');
-    font-weight: normal;
-    font-style: normal;
-}
-
-@font-face {
-    font-family: 'aller-bold';
-    src: url('public/fonts/aller-bold.eot');
-    src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'),
-         url('public/fonts/aller-bold.woff') format('woff'),
-         url('public/fonts/aller-bold.ttf') format('truetype');
-    font-weight: normal;
-    font-style: normal;
-}
-
-@font-face {
-    font-family: 'novecento-bold';
-    src: url('public/fonts/novecento-bold.eot');
-    src: url('public/fonts/novecento-bold.eot?#iefix') format('embedded-opentype'),
-         url('public/fonts/novecento-bold.woff') format('woff'),
-         url('public/fonts/novecento-bold.ttf') format('truetype');
-    font-weight: normal;
-    font-style: normal;
-}
-
-/*--------------------- Layout ----------------------------*/
-html { height: 100%; }
-body {
-  font-family: "aller-light";
-  font-size: 14px;
-  line-height: 18px;
-  color: #30404f;
-  margin: 0; padding: 0;
-  height:100%;
-}
-#container { min-height: 100%; }
-
-a {
-  color: #000;
-}
-
-b, strong {
-  font-weight: normal;
-  font-family: "aller-bold";
-}
-
-p, ul, ol {
-  margin: 15px 0 0px;
-}
-
-h1, h2, h3, h4, h5, h6 {
-  color: #112233;
-  line-height: 1em;
-  font-weight: normal;
-  font-family: "novecento-bold";
-  text-transform: uppercase;
-  margin: 30px 0 15px 0;
-}
-
-h1 {
-  margin-top: 40px;
-}
-
-hr {
-  border: 0;
-  background: 1px solid #ddd;
-  height: 1px;
-  margin: 20px 0;
-}
-
-pre, tt, code {
-  font-size: 12px; line-height: 16px;
-  font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
-  margin: 0; padding: 0;
-}
-  .annotation pre {
-    display: block;
-    margin: 0;
-    padding: 7px 10px;
-    background: #fcfcfc;
-    -moz-box-shadow:    inset 0 0 10px rgba(0,0,0,0.1);
-    -webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
-    box-shadow:         inset 0 0 10px rgba(0,0,0,0.1);
-    overflow-x: auto;
-  }
-    .annotation pre code {
-      border: 0;
-      padding: 0;
-      background: transparent;
-    }
-
-
-blockquote {
-  border-left: 5px solid #ccc;
-  margin: 0;
-  padding: 1px 0 1px 1em;
-}
-  .sections blockquote p {
-    font-family: Menlo, Consolas, Monaco, monospace;
-    font-size: 12px; line-height: 16px;
-    color: #999;
-    margin: 10px 0 0;
-    white-space: pre-wrap;
-  }
-
-ul.sections {
-  list-style: none;
-  padding:0 0 5px 0;;
-  margin:0;
-}
-
-/*
-  Force border-box so that % widths fit the parent
-  container without overlap because of margin/padding.
-
-  More Info : http://www.quirksmode.org/css/box.html
-*/
-ul.sections > li > div {
-  -moz-box-sizing: border-box;    /* firefox */
-  -ms-box-sizing: border-box;     /* ie */
-  -webkit-box-sizing: border-box; /* webkit */
-  -khtml-box-sizing: border-box;  /* konqueror */
-  box-sizing: border-box;         /* css3 */
-}
-
-
-/*---------------------- Jump Page -----------------------------*/
-#jump_to, #jump_page {
-  margin: 0;
-  background: white;
-  -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
-  -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
-  font: 16px Arial;
-  cursor: pointer;
-  text-align: right;
-  list-style: none;
-}
-
-#jump_to a {
-  text-decoration: none;
-}
-
-#jump_to a.large {
-  display: none;
-}
-#jump_to a.small {
-  font-size: 22px;
-  font-weight: bold;
-  color: #676767;
-}
-
-#jump_to, #jump_wrapper {
-  position: fixed;
-  right: 0; top: 0;
-  padding: 10px 15px;
-  margin:0;
-}
-
-#jump_wrapper {
-  display: none;
-  padding:0;
-}
-
-#jump_to:hover #jump_wrapper {
-  display: block;
-}
-
-#jump_page {
-  padding: 5px 0 3px;
-  margin: 0 0 25px 25px;
-}
-
-#jump_page .source {
-  display: block;
-  padding: 15px;
-  text-decoration: none;
-  border-top: 1px solid #eee;
-}
-
-#jump_page .source:hover {
-  background: #f5f5ff;
-}
-
-#jump_page .source:first-child {
-}
-
-/*---------------------- Low resolutions (> 320px) ---------------------*/
-@media only screen and (min-width: 320px) {
-  .pilwrap { display: none; }
-
-  ul.sections > li > div {
-    display: block;
-    padding:5px 10px 0 10px;
-  }
-
-  ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
-    padding-left: 30px;
-  }
-
-  ul.sections > li > div.content {
-    background: #f5f5ff;
-    overflow-x:auto;
-    -webkit-box-shadow: inset 0 0 5px #e5e5ee;
-    box-shadow: inset 0 0 5px #e5e5ee;
-    border: 1px solid #dedede;
-    margin:5px 10px 5px 10px;
-    padding-bottom: 5px;
-  }
-
-  ul.sections > li > div.annotation pre {
-    margin: 7px 0 7px;
-    padding-left: 15px;
-  }
-
-  ul.sections > li > div.annotation p tt, .annotation code {
-    background: #f8f8ff;
-    border: 1px solid #dedede;
-    font-size: 12px;
-    padding: 0 0.2em;
-  }
-}
-
-/*----------------------  (> 481px) ---------------------*/
-@media only screen and (min-width: 481px) {
-  #container {
-    position: relative;
-  }
-  body {
-    background-color: #F5F5FF;
-    font-size: 15px;
-    line-height: 21px;
-  }
-  pre, tt, code {
-    line-height: 18px;
-  }
-  p, ul, ol {
-    margin: 0 0 15px;
-  }
-
-
-  #jump_to {
-    padding: 5px 10px;
-  }
-  #jump_wrapper {
-    padding: 0;
-  }
-  #jump_to, #jump_page {
-    font: 10px Arial;
-    text-transform: uppercase;
-  }
-  #jump_page .source {
-    padding: 5px 10px;
-  }
-  #jump_to a.large {
-    display: inline-block;
-  }
-  #jump_to a.small {
-    display: none;
-  }
-
-
-
-  #background {
-    position: absolute;
-    top: 0; bottom: 0;
-    width: 350px;
-    background: #fff;
-    border-right: 1px solid #e5e5ee;
-    z-index: -1;
-  }
-
-  ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
-    padding-left: 40px;
-  }
-
-  ul.sections > li {
-    white-space: nowrap;
-  }
-
-  ul.sections > li > div {
-    display: inline-block;
-  }
-
-  ul.sections > li > div.annotation {
-    max-width: 350px;
-    min-width: 350px;
-    min-height: 5px;
-    padding: 13px;
-    overflow-x: hidden;
-    white-space: normal;
-    vertical-align: top;
-    text-align: left;
-  }
-  ul.sections > li > div.annotation pre {
-    margin: 15px 0 15px;
-    padding-left: 15px;
-  }
-
-  ul.sections > li > div.content {
-    padding: 13px;
-    vertical-align: top;
-    background: #f5f5ff;
-    border: none;
-    -webkit-box-shadow: none;
-    box-shadow: none;
-  }
-
-  .pilwrap {
-    position: relative;
-    display: inline;
-  }
-
-  .pilcrow {
-    font: 12px Arial;
-    text-decoration: none;
-    color: #454545;
-    position: absolute;
-    top: 3px; left: -20px;
-    padding: 1px 2px;
-    opacity: 0;
-    -webkit-transition: opacity 0.2s linear;
-  }
-    .for-h1 .pilcrow {
-      top: 47px;
-    }
-    .for-h2 .pilcrow, .for-h3 .pilcrow, .for-h4 .pilcrow {
-      top: 35px;
-    }
-
-  ul.sections > li > div.annotation:hover .pilcrow {
-    opacity: 1;
-  }
-}
-
-/*---------------------- (> 1025px) ---------------------*/
-@media only screen and (min-width: 1025px) {
-
-  body {
-    font-size: 16px;
-    line-height: 24px;
-  }
-
-  #background {
-    width: 525px;
-  }
-  ul.sections > li > div.annotation {
-    max-width: 525px;
-    min-width: 525px;
-    padding: 10px 25px 1px 50px;
-  }
-  ul.sections > li > div.content {
-    padding: 9px 15px 16px 25px;
-  }
-}
-
-/*---------------------- Syntax Highlighting -----------------------------*/
-
-td.linenos { background-color: #f0f0f0; padding-right: 10px; }
-span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
-/*
-
-github.com style (c) Vasily Polovnyov <vast@whiteants.net>
-
-*/
-
-pre code {
-  display: block; padding: 0.5em;
-  color: #000;
-  background: #f8f8ff
-}
-
-pre .comment,
-pre .template_comment,
-pre .diff .header,
-pre .javadoc {
-  color: #408080;
-  font-style: italic
-}
-
-pre .keyword,
-pre .assignment,
-pre .literal,
-pre .css .rule .keyword,
-pre .winutils,
-pre .javascript .title,
-pre .lisp .title,
-pre .subst {
-  color: #954121;
-  /*font-weight: bold*/
-}
-
-pre .number,
-pre .hexcolor {
-  color: #40a070
-}
-
-pre .string,
-pre .tag .value,
-pre .phpdoc,
-pre .tex .formula {
-  color: #219161;
-}
-
-pre .title,
-pre .id {
-  color: #19469D;
-}
-pre .params {
-  color: #00F;
-}
-
-pre .javascript .title,
-pre .lisp .title,
-pre .subst {
-  font-weight: normal
-}
-
-pre .class .title,
-pre .haskell .label,
-pre .tex .command {
-  color: #458;
-  font-weight: bold
-}
-
-pre .tag,
-pre .tag .title,
-pre .rules .property,
-pre .django .tag .keyword {
-  color: #000080;
-  font-weight: normal
-}
-
-pre .attribute,
-pre .variable,
-pre .instancevar,
-pre .lisp .body {
-  color: #008080
-}
-
-pre .regexp {
-  color: #B68
-}
-
-pre .class {
-  color: #458;
-  font-weight: bold
-}
-
-pre .symbol,
-pre .ruby .symbol .string,
-pre .ruby .symbol .keyword,
-pre .ruby .symbol .keymethods,
-pre .lisp .keyword,
-pre .tex .special,
-pre .input_number {
-  color: #990073
-}
-
-pre .builtin,
-pre .constructor,
-pre .built_in,
-pre .lisp .title {
-  color: #0086b3
-}
-
-pre .preprocessor,
-pre .pi,
-pre .doctype,
-pre .shebang,
-pre .cdata {
-  color: #999;
-  font-weight: bold
-}
-
-pre .deletion {
-  background: #fdd
-}
-
-pre .addition {
-  background: #dfd
-}
-
-pre .diff .change {
-  background: #0086b3
-}
-
-pre .chunk {
-  color: #aaa
-}
-
-pre .tex .formula {
-  opacity: 0.5;
-}
deleted file mode 100644
--- a/testing/xpcshell/node-http2/node_modules/http2-protocol/doc/endpoint.html
+++ /dev/null
@@ -1,658 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-  <title>endpoint.js</title>
-  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
-  <link rel="stylesheet" media="all" href="docco.css" />
-</head>
-<body>
-  <div id="container">
-    <div id="background"></div>
-    
-      <ul id="jump_to">
-        <li>
-          <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
-          <a class="small" href="javascript:void(0);">+</a>
-          <div id="jump_wrapper">
-          <div id="jump_page">
-            
-              
-              <a class="source" href="compressor.html">
-                compressor.js
-              </a>
-            
-              
-              <a class="source" href="connection.html">
-                connection.js
-              </a>
-            
-              
-              <a class="source" href="endpoint.html">
-                endpoint.js
-              </a>
-            
-              
-              <a class="source" href="flow.html">
-                flow.js
-              </a>
-            
-              
-              <a class="source" href="framer.html">
-                framer.js
-              </a>
-            
-              
-              <a class="source" href="index.html">
-                index.js
-              </a>
-            
-              
-              <a class="source" href="stream.html">
-                stream.js
-              </a>
-            
-          </div>
-        </li>
-      </ul>
-    
-    <ul class="sections">
-        
-          <li id="title">
-              <div class="annotation">
-                  <h1>endpoint.js</h1>
-