Files
palemoon27/testing/xpcshell/node-http2
roytam1 54259209d7 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 891551 - Part 7: Fix some intermittent failures in multi_tcp_socket_unittest. r=ekr (b0fb5f6167)
- Bug 891551 - Part 11: fix a couple of issues from part 5. r=bwc (1f3586e037)
- Bug 1131779: 403 on permission request no longer invalidates the whole TURN relay. r=bwc (d0c594e2c7)
- Bug 797262 - IPV6 support for webrtc. r=drno (91894f480c)
- Bug 1187775 - Plumb RTCConfiguration.iceTransportPolicy down to NrIceCtx. r=smaug, r=bwc (1edc8f89c7)
- Bug 1191258 - check for IFF_RUNNING to detect online interfaces. r=mcmanus (3882c4d36e)
- Bug 1191253 - start the link monitor, ignore link-local notifications. r=mcmanus (f26b864061)
- Bug 1203658 - mark Linux's nsNotifyAddrListener::mChildThreadShutdown member as Atomic; r=bagder (6459a89dc0)
- re-enable warnings (e132d2f5db)
- Bug 1205266 - log network-change events on Mac. r=mcmanus (4c50d25945)
- Bug 1163419 - Make nsQtNetworkLinkService destructor private. r=dougt (c6993deef9)
- Bug 1178091: Implement RTCDataChannel BufferedAmountLowThreshold and bufferedamountlow event r=smaug,drno (0536f587b4)
- Bug 1194817: disable PMTUD in DataChannels/SCTP, set initial MTU per spec r=tuexen (60db372861)
- Bug 1198730: fix simple bug in PMTUD disable that clears all other flags r=tuexen (aeac9858cf)
- Bug 1148231: fix wrong error message on DataChannel failed resend of packet r=khuey (c1d9d11e17)
- Bug 1152334 - StartWebsocketData null deref mSocketIn, r=bagder (e55850770e)
- Bug 1149872 - Add the missing format specifiers. r=jduell (ffef5c91c2)
- Bug 1182515 - WebSocketChannel leaked when WebSocketChannel::AsyncOpen fails, r=mcmanus (0b52e2eb82)
- Bug 1140765 - Build some network code in unified mode; r=mcmanus (a6b9c325bb)
- Bug 1147749 - View source should go through service worker interception, r=bz, r=jduell (8c5a3cab90)
- Bug 1137151: Marked destructors of ref-counted RTSP classes as protected, r=sworkman (a6873944ee)
- Bug 1117486 - [FFOS2.0][Woodduck] System crash by replaying the same RTSP clip several times. r=bechen (1401ee0f11)
- Bug 1133461 - [RTSP] Remove the extra PLAY request for seek operation. r=bechen (c603b06ac6)
- Bug 1138983 - RTSP not enabled in Lollipop. r=vchang (a42d0bcd30)
- Bug 1144513 - [gonk-lmr1] Adapt RTSPSource.cpp. r=ettseng (8e011ab7bf)
- Bug 1151760 - Separate timeout timer with end of stream. r=ettseng (60bb18556c)
- Bug 1208756 - Hoist shared CheckMayLoad logic into BasePrincipal. r=bz (0108fa0c7c)
- Bug 1208756 - Introduce URI_FETCHABLE_BY_ANYONE and use it for moz-extension. r=bz (04de31fcbd)
- Bug 1188421 - Properly null memory reporter's compressor reference. r=hurley (9275695d87)
- bug 1204614 - test for h2 per stream flow control r=hurley (a56d4aacff)
- Bug 1197847 - Disallow folded headers in h2. r=mcmanus (ec5febf843)
- Bug 1136361 - update node-http2 on ci. rs=mcmanus (a7e2de9e02)
- Bug 1197847 - make debugging h2 and spdy test servers easier. r=mcmanus (7dcc251b63)
- Missing bits of 1132357 (431f194ed7)
- Bug 1207519 - Prevent HashTable shrink from ignoring allocation failures that may have been reported r=Waldo (d9270ce946)
- Bug 920479 - Properly convert all arguments to the Function constructor to strings before parsing out an arguments list for the function to be created. r=arai (2ba9fb0af0)
- Bug 1206520: Create an option to throw on asm.js validation failures; r=luke (6a19a37db7)
- Bug 1210295 - Simplify TOK_DEFAULT case in Parser::exportDeclaration. r=Waldo (850e383381)
- code style (5356d4a123)
- Bug 589199 - Mark non-global lexical scopes are non-extensible. (r=efaust) (d0430a0f5e)
- Bug 589199 - Cleanup: remove unused DEPTH_SLOT from BlockObject. (r=efaust) (97206b2b00)
- Bug 1211100 - Add Vector::infallibleEmplaceBack and use it in JSScript::initScriptCounts() r=nbp (09705ff8db)
- Bug 1199203 - Add support for per-thread OOM testing. r=jonco (2a9919d659)
- Bug 1171226 - Fix mozilla::devtools::UniqueStringHashPolicy::match for strings with the same prefix; r=jimb (1843cec175)
- Bug 1206290 - Part 0: Move js/UbiNodeTraverse.h to js/UbiNodeBreadthFirst.h; r=sfink (c22e008995)
- Bug 1199843 - Part 1: Prefer T::traceChildren over tag dispatched TraceChildren; r=jonco (d935bb1c1c)
- Bug 1199843 - Part 2: Use js::TraceChildren everywhere we don't need external linkage; r=jonco (de8cd29a01)
- Bug 1199843 - Part 3: Strongly type JS::TraceChildren; r=jonco r=mccr8 (2cdd931159)
- Bug 1178961 - Restore the std::string fix from bug 1167230 r=BenWa (4251402fce)
- Bug 1206288 - Remove JS::ubi::SimpleEdge and make JS::ubi::Edge a concrete class; r=shu (d995efed2d)
- Bug 1182653 - Use JSRuntime* instead of JSContext* in ubi::Node infrastructure; r=sfink (e11e0bd0ba)
- Bug 1207236 - ARM64: Build errors with --enable-simulator=arm64. r=h4writer (cc76d43493)
- Bug 1207793 - Fix unified bustage from the TaggedPointer split; r=jolesen (e05b300406)
- Bug 1204866 - IonMonkey: Crash when failing to apand to parse finished list, r=bhackett (efab1b4a1f)
- Bug 1209911 - Use a Variant type to represent HelperThread data r=jandem (ea21131f21)
- Bug 1209911 - Make AutoEnterOOMUnsafeRegion ignore threads that are not simulating OOM r=terrence (769f06a4dc)
- Bug 1203814 - "Adding a testing function causes intermittent orange in oomInFormatStackDump.js on Win32 debug SM(p)." r=jcoppeard (da95054606)
- Bug 1209911 - Add oomThreadTypes() test function to report the number of thread types we can simulate OOM on r=terrence (1d56ca0b74)
- Bug 1209911 - Limit the number of helper threads of a particular type when simulating OOM r=jandem (ceafa83794)
- Bug 1209911 - Remove option to simulate OOM on all threads r=terrence (b43fcf3959)
- Bug 1201057 - Update shell args for OOM tests now we don't have to worry about unhandlable OOMs r=terrence (843c1fc6e3)
- Bug 1208994 - ToAtom<NoGC> should not throw an exception on failure r=terrence (ad57246c1e)
- Bug 1210760 - Don't simulate OOM in ExceptionHandlerBailout() r=terrence (89bab8d51b)
- Bug 1209911 - Enable threads for existing OOM tests r=terrence (a6f94e1f2f)
- Bug 1169974 - Tolerate inconsistent-missing-override warnings for MOCK_METHOD2 macro from gtests. r=fitzgen. (96d613239d)
- Bug 1206290 - Part 1: Implement a JS::ubi::PostOrder depth first traversal; r=sfink (d4de3aa8bc)
- Bug 1196461 - De-duplicate strings in heap snapshot core dumps; r=shu,jimb (24080971ae)
- missing bit of 1101561 (d4b61c9688)
- Bug 1199215 - Implement JS::ubi::Node::size for JS::Symbol referents;S::ubi::Node::size for JS::Symbol referents; r=sfink (929fceb199)
- Bug 1200345: Add comment to js/public/UbiNode.h warning about operating on graphs constructed by hostile code. DONTBUILD r=fitzgen (b83c2d0aad)
- Bug 1199216 - Implement JS::ubi::Node::size for JSScript referents; r=sfink (5a134ffa8e)
- Bug 1205744 - Removed redundant method IsContextRunningJS. r=h4writer (a7e90bbead)
- Bug 1203920 - Get rid of JS_SetStructuredCloneCallbacks, r=sfink (197118cf95)
- Bug 1204554 part 1 - Remove unused JSContext from LcovWriteScript. r=bhackett (12fa4dcc99)
- Bug 1209263 - Allow embedders to tell SpiderMonkey how to structured clone principals; r=bz (c4e929e50f)
- Bug 1191098 - Replace AutoHashableValueRooter with Rooted<HashableValue>; r=jonco (99e23cf3a4)
- Bug 1190628 - Replace AutoScriptVector with normal Rooted usage; r=jimb (926d499edd)
- Bug 1188445 - Allow PersistentRooted to store StaticTraceable; r=sfink (eac1824298)
- Bug 1195957 - Implement a Swap for Heap<T> that does not put temporaries on the stack, r=terrence (26935b5efd)
- Bug 1203695 - GenerateLcovInfo: Check if JSScripts have associated bytecode before spewing their content. r=bhackett (71854b606a)
- Bug 1204554 part 2 - Split LCov functions to make the aggregation of results incremental. r=terrence,bhackett (3a6bd8719e)
- Bug 1204554 part 3.0 - Collect lcov output on the JSCompartment, and on the JSRuntime. r=terrence,bhackett (35544460b1)
- Bug 1204554 part 3.1 - Prevent lazy parsing if we have to spew lcov result. r=bhackett (b36775e171)
- Bug 1204554 part 3.2 - Collect the source files before any script, as they are swept first. r=terrence (4d841a641e)
- Bug 1204554 part 3.3 - Only collect inner JSScript if they have the same source. r=terrence (b38f45764e)
- Bug 1204554 part 3.4 - Ensure that scriptCountsMaps data are still alive until the destruction of compartments. r=terrence,bhackett (50d4217d20)
- Bug 1200642 - Fix OOM handling issues r=terrence (d8ba8b1714)
- Bug 1206247 - Do not collect coverage information if the source has n filename. r=bhackett (0602188d8e)
- pointer style (09cd14aec3)
- Bug 1207232: Let lockOwner be Atomic; r=terrence (e4aa1e635d)
- Bug 1192304 - Common up the checks when entering GC API; r=jonco (935c618bc4)
- Bug 1192306 - Use a function to check if IsShutdownGC rather than open-coding it; r=jonco (c14a96ba2d)
- Bug 1202865 - Split out Zone selection from stats collection and malloc bytes reset; r=jonco (89d5e9def1)
- Bug 1193428 - Rename the incremental parameter to be more meaningful; r=jonco (5d5f38b39d)
- Bug 1209704 - Part 1: Rename BarrieredBase to WriteBarrieredBase; r=jonco (4559ae15aa)
- Bug 1209704 - Part 2: Share storage and mixins between Read and Write barriers; r=jonco (eddc9ff80c)
- Bug 1177515 - Skip tracing object elements if type information shows they don't contain any GC pointers r=terrence (94e2c1ee71)
- Bug 1209704 - Part 3: Share tracing accessors between all barrier classes; r=jonco (1e30d0f16d)
- Bug 1209704 - Part 4: Add a post-barrier to ReadBarriered; r=jonco (22bb316d70)
- Bug 1211022 - Add a type specialization for weak C++ GC thing references; r=sfink (d3d5e88ba8)
- Bug 1204169 - Push SPS pseudo frame entries when GCing; r=terrence (61501f7597)
- Bug 1211031 - Use WeakRef to manage the LazyScript to JSScript back-reference; r=jandem (7c48b04d35)
- Bug 1204167 - Create the js::AutoSPSEntry RAII class for defining psuedo frame entries; r=djvj (519342668f)
- Bug 1204584 - Ensure that entries created by AutoSPSEntry propogate their category information; r=djvj (bd5d96e8b6)
- Bug 1011786 - Diagnostic patch to detect cyclic ropes, r=terrence (c2ece1d49d)
- fix comment (619a5bff31)
2022-08-15 10:15:32 +08:00
..

node-http2

An HTTP/2 (draft-ietf-httpbis-http2-16) client and server implementation for node.js.

Travis CI status

Installation

npm install http2

API

The API is very similar to the standard node.js HTTPS API. The goal is the perfect API compatibility, with additional HTTP2 related extensions (like server push).

Detailed API documentation is primarily maintained in the lib/http.js file and is available in the wiki as well.

Examples

Using as a server

var options = {
  key: fs.readFileSync('./example/localhost.key'),
  cert: fs.readFileSync('./example/localhost.crt')
};

require('http2').createServer(options, function(request, response) {
  response.end('Hello world!');
}).listen(8080);

Using as a client

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

require('http2').get('https://localhost:8080/', function(response) {
  response.pipe(process.stdout);
});

Simple static file server

An simple static file server serving up content from its own directory is available in the example directory. Running the server:

$ node ./example/server.js

Simple command line client

An example client is also available. Downloading the server's own source code from the server:

$ node ./example/client.js 'https://localhost:8080/server.js' >/tmp/server.js

Server push

For a server push example, see the source code of the example server and client.

Status

  • ALPN is not yet supported in node.js (see this issue). For ALPN support, you will have to use Shigeki Ohtsu's node.js fork until this code gets merged upstream.
  • Upgrade mechanism to start HTTP/2 over unencrypted channel is not implemented yet (issue #4)
  • Other minor features found in this list are not implemented yet

Development

Development dependencies

There's a few library you will need to have installed to do anything described in the following sections. After installing/cloning node-http2, run npm install in its directory to install development dependencies.

Used libraries:

For pretty printing logs, you will also need a global install of bunyan (npm install -g bunyan).

Developer documentation

The developer documentation is generated from the source code using docco and can be viewed online here. 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 (which runs very slowly, be patient). Code coverage summary as of version 3.0.1:

Statements   : 92.09% ( 1759/1910 )
Branches     : 82.56% ( 696/843 )
Functions    : 91.38% ( 212/232 )
Lines        : 92.17% ( 1753/1902 )

There's a hosted version of the detailed (line-by-line) coverage report here.

Logging

Logging is turned off by default. You can turn it on by passing a bunyan logger as log option when creating a server or agent.

When using the example server or client, it's very easy to turn logging on: set the HTTP2_LOG environment variable to fatal, error, warn, info, debug or trace (the logging level). To log every single incoming and outgoing data chunk, use HTTP2_LOG_DATA=1 besides HTTP2_LOG=trace. Log output goes to the standard error output. If the standard error is redirected into a file, then the log output is in bunyan's JSON format for easier post-mortem analysis.

Running the example server and client with info level logging output:

$ HTTP2_LOG=info node ./example/server.js
$ HTTP2_LOG=info node ./example/client.js 'http://localhost:8080/server.js' >/dev/null

Contributors

The co-maintainer of the project is Nick Hurley.

Code contributions are always welcome! People who contributed to node-http2 so far:

Special thanks to Google for financing the development of this module as part of their Summer of Code program (project: HTTP/2 prototype server implementation), and Nick Hurley of Mozilla, my GSoC mentor, who helped with regular code review and technical advices.

License

The MIT License

Copyright (C) 2013 Gábor Molnár gabor@molnar.es