Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http2: Introducing http/2 #14239

Closed
wants to merge 26 commits into from
Closed

http2: Introducing http/2 #14239

wants to merge 26 commits into from

Commits on Aug 3, 2017

  1. Configuration menu
    Copy the full SHA
    33ba2d8 View commit details
    Browse the repository at this point in the history
  2. tls: add tlsSocket.disableRenegotiation()

    Allows TLS renegotiation to be disabled per `TLSSocket` instance.
    Per HTTP/2, TLS renegotiation is forbidden after the initial
    connection prefix is exchanged.
    jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    1cc4d86 View commit details
    Browse the repository at this point in the history
  3. deps: add nghttp2 dependency

    jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    160197a View commit details
    Browse the repository at this point in the history
  4. http2: introducing HTTP/2

    At long last: The initial *experimental* implementation of HTTP/2.
    
    This is an accumulation of the work that has been done in the nodejs/http2
    repository, squashed down to a couple of commits. The original commit
    history has been preserved in the nodejs/http2 repository.
    
    This PR introduces the nghttp2 C library as a new dependency. This library
    provides the majority of the HTTP/2 protocol implementation, with the rest
    of the code here providing the mapping of the library into a usable JS API.
    
    Within src, a handful of new node_http2_*.c and node_http2_*.h files are
    introduced. These provide the internal mechanisms that interface with nghttp
    and define the `process.binding('http2')` interface.
    
    The JS API is defined within `internal/http2/*.js`.
    
    There are two APIs provided: Core and Compat.
    
    The Core API is HTTP/2 specific and is designed to be as minimal and as
    efficient as possible.
    
    The Compat API is intended to be as close to the existing HTTP/1 API as
    possible, with some exceptions.
    
    Tests, documentation and initial benchmarks are included.
    
    The `http2` module is gated by a new `--expose-http2` command line flag.
    When used, `require('http2')` will be exposed to users. Note that there
    is an existing `http2` module on npm that would be impacted by the introduction
    of this module, which is the main reason for gating this behind a flag.
    
    When using `require('http2')` the first time, a process warning will be
    emitted indicating that an experimental feature is being used.
    
    To run the benchmarks, the `h2load` tool (part of the nghttp project) is
    required: `./node benchmarks/http2/simple.js benchmarker=h2load`. Only
    two benchmarks are currently available.
    
    Additional configuration options to enable verbose debugging are provided:
    
    ```
    $ ./configure --debug-http2 --debug-nghttp2
    $ NODE_DEBUG=http2 ./node
    ```
    
    The `--debug-http2` configuration option enables verbose debug statements
    from the `src/node_http2_*` files. The `--debug-nghttp2` enables the nghttp
    library's own verbose debug output. The `NODE_DEBUG=http2` enables JS-level
    debug output.
    
    The following illustrates as simple HTTP/2 server and client interaction:
    
    (The HTTP/2 client and server support both plain text and TLS connections)
    
    ```jt client = http2.connect('http://localhost:80');
    const req = client.request({ ':path': '/some/path' });
    req.on('data', (chunk) => { /* do something with the data */ });
    req.on('end', () => {
      client.destroy();
    });
    
    // Plain text (non-TLS server)
    const server = http2.createServer();
    server.on('stream', (stream, requestHeaders) => {
      stream.respond({ ':status': 200 });
      stream.write('hello ');
      stream.end('world');
    });
    server.listen(80);
    ```
    
    ```js
    const http2 = require('http2');
    const client = http2.connect('http://localhost');
    
    ```
    
    Author: Anna Henningsen <[email protected]>
    Author: Colin Ihrig <[email protected]>
    Author: Daniel Bevenius <[email protected]>
    Author: James M Snell <[email protected]>
    Author: Jun Mukai
    Author: Kelvin Jin
    Author: Matteo Collina <[email protected]>
    Author: Robert Kowalski <[email protected]>
    Author: Santiago Gimeno <[email protected]>
    Author: Sebastiaan Deckers <[email protected]>
    Author: Yosuke Furukawa <[email protected]>
    jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    e1989a8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    998a4ad View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    148dedd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3223555 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fb3a9c6 View commit details
    Browse the repository at this point in the history
  9. test: fix flakiness in test-http2-client-upload

    Race condition in the closing of the stream causing failure on
    some platforms.
    jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    e721353 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f4f0a28 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    b9848a1 View commit details
    Browse the repository at this point in the history
  12. http2: refinement and test for socketError

    Fixes: nodejs/http2#184
    
    Refines the `'socketError'` event a bit and adds a test for the
    emission of the `'socketError'` event on the server. Client side
    is tested separately
    jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    8dcad26 View commit details
    Browse the repository at this point in the history
  13. http2: fix socketOnTimeout and a segfault

    Fixes: nodejs/http2#179
    
    Was fixing issue nodejs#179 and encountered a segault that was
    happening somewhat randomly on session destruction. Both
    should be fixed
    jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    754d713 View commit details
    Browse the repository at this point in the history
  14. http2: add range support for respondWith{File|FD}

    * respondWithFD now supports optional statCheck
    * respondWithFD and respondWithFile both support offset/length for
      range requests
    * Fix linting nits following most recent update
    jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    6371510 View commit details
    Browse the repository at this point in the history
  15. http2: doc and fixes to the Compatibility API

    PR-URL: nodejs/http2#186
    Reviewed-By: James M Snell <[email protected]>
    mcollina authored and jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    0bdfee6 View commit details
    Browse the repository at this point in the history
  16. http2: make writeHead behave like HTTP/1.

    PR-URL: nodejs/http2#186
    Reviewed-By: James M Snell <[email protected]>
    mcollina authored and jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    2f51e7d View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    571deed View commit details
    Browse the repository at this point in the history
  18. http2: refactor trailers API

    Rather than using the `'fetchTrailers'` event to collect trailers,
    a new `getTrailers` callback option is supported. If not set, the
    internals will skip calling out for trailers at all. Expands the
    test to make sure trailers work from the client side also.
    jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    ec70fc5 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    2358b11 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    d17aedb View commit details
    Browse the repository at this point in the history
  21. http2: minor cleanup

    jasnell committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    40bd27c View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    5e447fe View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    358b3df View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    b7539a6 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    886d2c6 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2017

  1. Configuration menu
    Copy the full SHA
    873c1c5 View commit details
    Browse the repository at this point in the history