DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
  "name": "http2",
  "version": "2.2.0",
  "description": "An HTTP/2 client and server implementation",
  "main": "lib/index.js",
  "engines": {
    "node": ">=0.10.19"
  "dependencies": {
    "http2-protocol": "0.9.x"
  "devDependencies": {
    "istanbul": "*",
    "chai": "*",
    "mocha": "*",
    "docco": "*",
    "bunyan": "*"
  "scripts": {
    "test": "istanbul test _mocha -- --reporter spec --slow 200",
    "prepublish": "docco lib/* --output doc --layout parallel --css doc/docco.css"
  "repository": {
    "type": "git",
    "url": "https://github.com/molnarg/node-http2.git"
  "homepage": "https://github.com/molnarg/node-http2",
  "bugs": {
    "url": "https://github.com/molnarg/node-http2/issues"
  "keywords": [
  "author": {
    "name": "Gábor Molnár",
    "email": "gabor@molnar.es",
    "url": "http://gabor.molnar.es"
  "contributors": [
      "name": "Nick Hurley"
      "name": "Mike Belshe"
  "license": "MIT",
  "readmeFilename": "README.md",
  "readme": "node-http2\n==========\n\nAn HTTP/2 ([draft-ietf-httpbis-http2-09](http://tools.ietf.org/html/draft-ietf-httpbis-http2-9))\nclient and server implementation for node.js.\n\nInstallation\n------------\n\n```\nnpm install http2\n```\n\nAPI\n---\n\nThe API is very similar to the [standard node.js HTTPS API](http://nodejs.org/api/https.html). The\ngoal is the perfect API compatibility, with additional HTTP2 related extensions (like server push).\n\nDetailed API documentation is primarily maintained in the `lib/http.js` file and is [available in\nthe wiki](https://github.com/molnarg/node-http2/wiki/Public-API) as well.\n\nExamples\n--------\n\n### Using as a server ###\n\n```javascript\nvar options = {\n  key: fs.readFileSync('./example/localhost.key'),\n  cert: fs.readFileSync('./example/localhost.crt')\n};\n\nrequire('http2').createServer(options, function(request, response) {\n  response.end('Hello world!');\n}).listen(8080);\n```\n\n### Using as a client ###\n\n```javascript\nprocess.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\";\n\nrequire('http2').get('https://localhost:8080/', function(response) {\n  response.pipe(process.stdout);\n});\n```\n\n### Simple static file server ###\n\nAn simple static file server serving up content from its own directory is available in the `example`\ndirectory. Running the server:\n\n```bash\n$ node ./example/server.js\n```\n\n### Simple command line client ###\n\nAn example client is also available. Downloading the server's own source code from the server:\n\n```bash\n$ node ./example/client.js 'https://localhost:8080/server.js' >/tmp/server.js\n```\n\n### Server push ###\n\nFor a server push example, see the source code of the example\n[server](https://github.com/molnarg/node-http2/blob/master/example/server.js) and\n[client](https://github.com/molnarg/node-http2/blob/master/example/client.js).\n\nStatus\n------\n\n* ALPN is not yet supported in node.js (see\n  [this issue](https://github.com/joyent/node/issues/5945)). For ALPN support, you will have to use\n  [Shigeki Ohtsu's node.js fork](https://github.com/shigeki/node/tree/alpn_support) until this code\n  gets merged upstream.\n* Upgrade mechanism to start HTTP/2 over unencrypted channel is not implemented yet\n  (issue [#4](https://github.com/molnarg/node-http2/issues/4))\n* Other minor features found in\n  [this list](https://github.com/molnarg/node-http2/issues?labels=feature) are not implemented yet\n\nDevelopment\n-----------\n\n### Development dependencies ###\n\nThere's a few library you will need to have installed to do anything described in the following\nsections. After installing/cloning node-http2, run `npm install` in its directory to install\ndevelopment dependencies.\n\nUsed libraries:\n\n* [mocha](http://visionmedia.github.io/mocha/) for tests\n* [chai](http://chaijs.com/) for assertions\n* [istanbul](https://github.com/gotwarlost/istanbul) for code coverage analysis\n* [docco](http://jashkenas.github.io/docco/) for developer documentation\n* [bunyan](https://github.com/trentm/node-bunyan) for logging\n\nFor pretty printing logs, you will also need a global install of bunyan (`npm install -g bunyan`).\n\n### Developer documentation ###\n\nThe developer documentation is located in the `doc` directory. The docs are usually updated only\nbefore releasing a new version. To regenerate them manually, run `npm run-script prepublish`.\nThere's a hosted version which is located [here](http://molnarg.github.io/node-http2/doc/).\n\n### Running the tests ###\n\nIt's easy, just run `npm test`. The tests are written in BDD style, so they are a good starting\npoint to understand the code.\n\n### Test coverage ###\n\nTo generate a code coverage report, run `npm test --coverage` (which runs very slowly, be patient).\nCode coverage summary as of version 1.0.1:\n```\nStatements   : 93.26% ( 1563/1676 )\nBranches     : 84.85% ( 605/713 )\nFunctions    : 94.81% ( 201/212 )\nLines        : 93.23% ( 1557/1670 )\n```\n\nThere's a hosted version of the detailed (line-by-line) coverage report\n[here](http://molnarg.github.io/node-http2/coverage/lcov-report/lib/).\n\n### Logging ###\n\nLogging is turned off by default. You can turn it on by passing a bunyan logger as `log` option when\ncreating a server or agent.\n\nWhen using the example server or client, it's very easy to turn logging on: set the `HTTP2_LOG`\nenvironment variable to `fatal`, `error`, `warn`, `info`, `debug` or `trace` (the logging level).\nTo log every single incoming and outgoing data chunk, use `HTTP2_LOG_DATA=1` besides\n`HTTP2_LOG=trace`. Log output goes to the standard error output. If the standard error is redirected\ninto a file, then the log output is in bunyan's JSON format for easier post-mortem analysis.\n\nRunning the example server and client with `info` level logging output:\n\n```bash\n$ HTTP2_LOG=info node ./example/server.js\n```\n\n```bash\n$ HTTP2_LOG=info node ./example/client.js 'http://localhost:8080/server.js' >/dev/null\n```\n\nContributors\n------------\n\nCode contributions are always welcome! People who contributed to node-http2 so far:\n\n* Nick Hurley\n* Mike Belshe\n\nSpecial thanks to Google for financing the development of this module as part of their [Summer of\nCode program](https://developers.google.com/open-source/soc/) (project: [HTTP/2 prototype server\nimplementation](https://google-melange.appspot.com/gsoc/project/google/gsoc2013/molnarg/5001)), and\nNick Hurley of Mozilla, my GSoC mentor, who helped with regular code review and technical advices.\n\nLicense\n-------\n\nThe MIT License\n\nCopyright (C) 2013 Gábor Molnár <gabor@molnar.es>\n",
  "_id": "http2@2.2.0",
  "_from": "http2@"