Giter Site home page Giter Site logo

node-http2-protocol's Introduction

node-http2-protocol

An HTTP/2 (draft-ietf-httpbis-http2-14) framing layer implementaion for node.js.

Travis CI status

Installation

npm install http2-protocol

Examples

API

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 (it may be slow, be patient). Code coverage summary as of version 0.13.0:

Statements   : 92.23% ( 1341/1454 )
Branches     : 86% ( 553/643 )
Functions    : 91.93% ( 148/161 )
Lines        : 92.32% ( 1335/1446 )

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

Logging

Contributors

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

  • Nick Hurley
  • Mike Belshe
  • vsemogutor

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 [email protected]

node-http2-protocol's People

Contributors

nwgh avatar vsemogutor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-http2-protocol's Issues

Flow control may block non-flow-controlled frames

For all frame types, lib/stream.js uses this._pushUpstream to submit the frame for sending, which in turn calls Flow.prototype.push. In Flow.prototype.push, we could conceivably get into a state where there are DATA frames queued (so this._queue.length !== 0), so moreNeeded will not get set to non-null, and the check on line 278 will evaluate to true, thus enqueuing the frame, regardless of what type of frame it is. We should check the frame type in Flow.prototype.push before checking moreNeeded at all, so we don't end up blocking non-flow-controlled frames (I think).

I can whip up a patch for this, but I wanted to submit the issue to make sure I'm not crazy before doing the work :)

header compression error

Recently we have built some HPACK test cases https://github.com/Jxck/hpack-test-case
I'd like to add node-http2 compressor to there. While doing that, I found a bug in HeaderTable.prototype._enforceLimit. The code you should look at is:

droppedEntries[droppedEntries] = dropped;

droppedEntries is an array and stores the dropped entries. But the above code sets itself as index, which is apparently a bug.

I suspect that it is dropPoint, but I leave the fix for you. (I'm not really Nodejs guy)

The failed testcase is https://github.com/Jxck/hpack-test-case/blob/master/nghttp2/story_20.json When encoded by node-http2 compressor, at case #37 (1-based), it emits 2 empty name/value pairs.

Unknown frame types must be ignored

Implementations MUST ignore frames of unsupported or unrecognized types (draft-09, section 4.1). Now endpoint fails when receives incoming frame with unknown frame type in function readCommonHeader.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.