From 8a0869b484d0d9d0d8535bb03d9919bcdb6a45ae Mon Sep 17 00:00:00 2001 From: Nicholas Hurley Date: Mon, 1 Aug 2016 10:03:35 -0700 Subject: [PATCH] Update links in documentation --- lib/http.js | 49 ++++++++++++++++---------------------- lib/index.js | 10 ++++---- lib/protocol/compressor.js | 27 ++++++++++----------- lib/protocol/flow.js | 10 ++++---- lib/protocol/framer.js | 36 ++++++++++++++-------------- lib/protocol/index.js | 21 ++++++++-------- lib/protocol/stream.js | 10 ++++---- package.json | 2 +- 8 files changed, 78 insertions(+), 87 deletions(-) diff --git a/lib/http.js b/lib/http.js index d71513d..4c4234c 100644 --- a/lib/http.js +++ b/lib/http.js @@ -11,17 +11,15 @@ // ------------------------------------ // // - **Class: http2.Endpoint**: an API for using the raw HTTP/2 framing layer. For documentation -// see the [lib/endpoint.js](endpoint.html) file. +// see [protocol/endpoint.js](protocol/endpoint.html). // // - **Class: http2.Server** // - **Event: 'connection' (socket, [endpoint])**: there's a second argument if the negotiation of -// HTTP/2 was successful: the reference to the [Endpoint](endpoint.html) object tied to the +// HTTP/2 was successful: the reference to the [Endpoint](protocol/endpoint.html) object tied to the // socket. // // - **http2.createServer(options, [requestListener])**: additional option: // - **log**: an optional [bunyan](https://github.com/trentm/node-bunyan) logger object -// - **plain**: if `true`, the server will accept HTTP/2 connections over plain TCP instead of -// TLS // // - **Class: http2.ServerResponse** // - **response.push(options)**: initiates a server push. `options` describes the 'imaginary' @@ -33,20 +31,17 @@ // - **new Agent(options)**: additional option: // - **log**: an optional [bunyan](https://github.com/trentm/node-bunyan) logger object // - **agent.sockets**: only contains TCP sockets that corresponds to HTTP/1 requests. -// - **agent.endpoints**: contains [Endpoint](endpoint.html) objects for HTTP/2 connections. +// - **agent.endpoints**: contains [Endpoint](protocol/endpoint.html) objects for HTTP/2 connections. // -// - **http2.request(options, [callback])**: additional option: -// - **plain**: if `true`, the client will not try to build a TLS tunnel, instead it will use -// the raw TCP stream for HTTP/2 +// - **http2.request(options, [callback])**: +// - similar to http.request // -// - **http2.get(options, [callback])**: additional option: -// - **plain**: if `true`, the client will not try to build a TLS tunnel, instead it will use -// the raw TCP stream for HTTP/2 -// - this performs request and then also calls request.end() for request instance +// - **http2.get(options, [callback])**: +// - similar to http.get // // - **Class: http2.ClientRequest** // - **Event: 'socket' (socket)**: in case of an HTTP/2 incoming message, `socket` is a reference -// to the associated [HTTP/2 Stream](stream.html) object (and not to the TCP socket). +// to the associated [HTTP/2 Stream](protocol/stream.html) object (and not to the TCP socket). // - **Event: 'push' (promise)**: signals the intention of a server push associated to this // request. `promise` is an IncomingPromise. If there's no listener for this event, the server // push is cancelled. @@ -57,7 +52,7 @@ // - has two subclasses for easier interface description: **IncomingRequest** and // **IncomingResponse** // - **message.socket**: in case of an HTTP/2 incoming message, it's a reference to the associated -// [HTTP/2 Stream](stream.html) object (and not to the TCP socket). +// [HTTP/2 Stream](protocol/stream.html) object (and not to the TCP socket). // // - **Class: http2.IncomingRequest (IncomingMessage)** // - **message.url**: in case of an HTTP/2 incoming request, the `url` field always contains the @@ -92,11 +87,11 @@ // but will function normally when falling back to using HTTP/1.1. // // - **Class: http2.Server** -// - **Event: 'checkContinue'**: not in the spec, yet (see [http-spec#18][expect-continue]) +// - **Event: 'checkContinue'**: not in the spec // - **Event: 'upgrade'**: upgrade is deprecated in HTTP/2 // - **Event: 'timeout'**: HTTP/2 sockets won't timeout because of application level keepalive // (PING frames) -// - **Event: 'connect'**: not in the spec, yet (see [http-spec#230][connect]) +// - **Event: 'connect'**: not yet supported // - **server.setTimeout(msecs, [callback])** // - **server.timeout** // @@ -124,11 +119,9 @@ // - **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-16#section-8.1.2.4 -// [expect-continue]: https://github.com/http2/http2-spec/issues/18 -// [connect]: https://github.com/http2/http2-spec/issues/230 +// [1]: https://nodejs.org/api/https.html +// [2]: https://nodejs.org/api/http.html +// [3]: https://tools.ietf.org/html/rfc7540#section-8.1.2.4 // Common server and client side code // ================================== @@ -162,7 +155,7 @@ var deprecatedHeaders = [ // When doing NPN/ALPN negotiation, HTTP/1.1 is used as fallback var supportedProtocols = [protocol.VERSION, 'http/1.1', 'http/1.0']; -// Ciphersuite list based on the recommendations of http://wiki.mozilla.org/Security/Server_Side_TLS +// Ciphersuite list based on the recommendations of https://wiki.mozilla.org/Security/Server_Side_TLS // The only modification is that kEDH+AESGCM were placed after DHE and ECDHE suites var cipherSuites = [ 'ECDHE-RSA-AES128-GCM-SHA256', @@ -226,7 +219,7 @@ exports.serializers = protocol.serializers; // --------------------- function IncomingMessage(stream) { - // * This is basically a read-only wrapper for the [Stream](stream.html) class. + // * This is basically a read-only wrapper for the [Stream](protocol/stream.html) class. PassThrough.call(this); stream.pipe(this); this.socket = this.stream = stream; @@ -250,7 +243,7 @@ function IncomingMessage(stream) { } IncomingMessage.prototype = Object.create(PassThrough.prototype, { constructor: { value: IncomingMessage } }); -// [Request Header Fields](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-8.1.2.3) +// [Request Header Fields](https://tools.ietf.org/html/rfc7540#section-8.1.2.3) // * `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. @@ -326,7 +319,7 @@ IncomingMessage.prototype._validateHeaders = function _validateHeaders(headers) // --------------------- function OutgoingMessage() { - // * This is basically a read-only wrapper for the [Stream](stream.html) class. + // * This is basically a read-only wrapper for the [Stream](protocol/stream.html) class. Writable.call(this); this._headers = {}; @@ -535,7 +528,7 @@ Server.prototype._fallback = function _fallback(socket) { // There are [3 possible signatures][1] of the `listen` function. Every arguments is forwarded to // the backing TCP or HTTPS server. -// [1]: http://nodejs.org/api/http.html#http_server_listen_port_hostname_backlog_callback +// [1]: https://nodejs.org/api/http.html#http_server_listen_port_hostname_backlog_callback Server.prototype.listen = function listen(port, hostname) { this._log.info({ on: ((typeof hostname === 'string') ? (hostname + ':' + port) : port) }, 'Listening for incoming connections'); @@ -659,7 +652,7 @@ function IncomingRequest(stream) { } IncomingRequest.prototype = Object.create(IncomingMessage.prototype, { constructor: { value: IncomingRequest } }); -// [Request Header Fields](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-8.1.2.3) +// [Request Header Fields](https://tools.ietf.org/html/rfc7540#section-8.1.2.3) // * `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. @@ -1214,7 +1207,7 @@ function IncomingResponse(stream) { } IncomingResponse.prototype = Object.create(IncomingMessage.prototype, { constructor: { value: IncomingResponse } }); -// [Response Header Fields](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-8.1.2.4) +// [Response Header Fields](https://tools.ietf.org/html/rfc7540#section-8.1.2.4) // * `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. diff --git a/lib/index.js b/lib/index.js index 60981c2..c67883d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,4 @@ -// [node-http2][homepage] is an [HTTP/2 (draft 16)][http2] implementation for [node.js][node]. +// [node-http2][homepage] is an [HTTP/2][http2] implementation for [node.js][node]. // // The core of the protocol is implemented in the protocol sub-directory. This directory provides // two important features on top of the protocol: @@ -10,10 +10,10 @@ // (which is in turn very similar to the [HTTP module API][node-http]). // // [homepage]: https://github.com/molnarg/node-http2 -// [http2]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-16 -// [node]: http://nodejs.org/ -// [node-https]: http://nodejs.org/api/https.html -// [node-http]: http://nodejs.org/api/http.html +// [http2]: https://tools.ietf.org/html/rfc7540 +// [node]: https://nodejs.org/ +// [node-https]: https://nodejs.org/api/https.html +// [node-http]: https://nodejs.org/api/http.html module.exports = require('./http'); diff --git a/lib/protocol/compressor.js b/lib/protocol/compressor.js index 5aacae5..f1d1795 100644 --- a/lib/protocol/compressor.js +++ b/lib/protocol/compressor.js @@ -11,9 +11,9 @@ // provide a layer between the [framer](framer.html) and the // [connection handling component](connection.html). // -// [node-transform]: http://nodejs.org/api/stream.html#stream_class_stream_transform -// [node-objectmode]: http://nodejs.org/api/stream.html#stream_new_stream_readable_options -// [http2-compression]: http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07 +// [node-transform]: https://nodejs.org/api/stream.html#stream_class_stream_transform +// [node-objectmode]: https://nodejs.org/api/stream.html#stream_new_stream_readable_options +// [http2-compression]: https://tools.ietf.org/html/rfc7541 exports.HeaderTable = HeaderTable; exports.HuffmanTable = HuffmanTable; @@ -35,8 +35,8 @@ var util = require('util'); // The [Header Table] is a component used to associate headers to index values. It is basically an // ordered list of `[name, value]` pairs, so it's implemented as a subclass of `Array`. // In this implementation, the Header Table and the [Static Table] are handled as a single table. -// [Header Table]: http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#section-3.1.2 -// [Static Table]: http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B +// [Header Table]: https://tools.ietf.org/html/rfc7541#section-2.3.2 +// [Static Table]: https://tools.ietf.org/html/rfc7541#section-2.3.1 function HeaderTable(log, limit) { var self = HeaderTable.staticTable.map(entryFromPair); self._log = log; @@ -70,7 +70,7 @@ function size(entry) { } // The `add(index, entry)` can be used to [manage the header table][tablemgmt]: -// [tablemgmt]: http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#section-3.3 +// [tablemgmt]: https://tools.ietf.org/html/rfc7541#section-4 // // * it pushes the new `entry` at the beggining of the table // * before doing such a modification, it has to be ensured that the header table size will stay @@ -115,9 +115,8 @@ HeaderTable.prototype.setSizeLimit = function setSizeLimit(limit) { this._enforceLimit(this._limit); }; -// [The Static Table](http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B) +// [The Static Table](https://tools.ietf.org/html/rfc7541#section-2.3.1) // ------------------ -// [statictable]:http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B // The table is generated with feeding the table from the spec to the following sed command: // @@ -208,14 +207,14 @@ function HeaderSetDecompressor(log, table) { // `_transform` is the implementation of the [corresponding virtual function][_transform] of the // TransformStream class. It collects the data chunks for later processing. -// [_transform]: http://nodejs.org/api/stream.html#stream_transform_transform_chunk_encoding_callback +// [_transform]: https://nodejs.org/api/stream.html#stream_transform_transform_chunk_encoding_callback HeaderSetDecompressor.prototype._transform = function _transform(chunk, encoding, callback) { this._chunks.push(chunk); callback(); }; // `execute(rep)` executes the given [header representation][representation]. -// [representation]: http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#section-3.1.4 +// [representation]: https://tools.ietf.org/html/rfc7541#section-6 // The *JavaScript object representation* of a header representation: // @@ -281,7 +280,7 @@ HeaderSetDecompressor.prototype._execute = function _execute(rep) { // `_flush` is the implementation of the [corresponding virtual function][_flush] of the // TransformStream class. The whole decompressing process is done in `_flush`. It gets called when // the input stream is over. -// [_flush]: http://nodejs.org/api/stream.html#stream_transform_flush_callback +// [_flush]: https://nodejs.org/api/stream.html#stream_transform_flush_callback HeaderSetDecompressor.prototype._flush = function _flush(callback) { var buffer = concat(this._chunks); @@ -327,7 +326,7 @@ HeaderSetCompressor.prototype.send = function send(rep) { // `_transform` is the implementation of the [corresponding virtual function][_transform] of the // TransformStream class. It processes the input headers one by one: -// [_transform]: http://nodejs.org/api/stream.html#stream_transform_transform_chunk_encoding_callback +// [_transform]: https://nodejs.org/api/stream.html#stream_transform_transform_chunk_encoding_callback HeaderSetCompressor.prototype._transform = function _transform(pair, encoding, callback) { var name = pair[0].toLowerCase(); var value = pair[1]; @@ -373,12 +372,12 @@ HeaderSetCompressor.prototype._transform = function _transform(pair, encoding, c // `_flush` is the implementation of the [corresponding virtual function][_flush] of the // TransformStream class. It gets called when there's no more header to compress. The final step: -// [_flush]: http://nodejs.org/api/stream.html#stream_transform_flush_callback +// [_flush]: https://nodejs.org/api/stream.html#stream_transform_flush_callback HeaderSetCompressor.prototype._flush = function _flush(callback) { callback(); }; -// [Detailed Format](http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#section-4) +// [Detailed Format](https://tools.ietf.org/html/rfc7541#section-5) // ----------------- // ### Integer representation ### diff --git a/lib/protocol/flow.js b/lib/protocol/flow.js index 687662e..1647807 100644 --- a/lib/protocol/flow.js +++ b/lib/protocol/flow.js @@ -5,7 +5,7 @@ var assert = require('assert'); // Flow is a [Duplex stream][1] subclass which implements HTTP/2 flow control. It is designed to be // subclassed by [Connection](connection.html) and the `upstream` component of [Stream](stream.html). -// [1]: http://nodejs.org/api/stream.html#stream_class_stream_duplex +// [1]: https://nodejs.org/api/stream.html#stream_class_stream_duplex var Duplex = require('stream').Duplex; @@ -19,7 +19,7 @@ exports.Flow = Flow; // * **setInitialWindow(size)**: the initial flow control window size can be changed *any time* // ([as described in the standard][1]) using this method // -// [1]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.9.2 +// [1]: https://tools.ietf.org/html/rfc7540#section-6.9.2 // API for child classes // --------------------- @@ -42,7 +42,7 @@ exports.Flow = Flow; // * **read(limit): frame**: like the regular `read`, but the 'flow control size' (0 for non-DATA // frames, length of the payload for DATA frames) of the returned frame will be under `limit`. // Small exception: pass -1 as `limit` if the max. flow control size is 0. `read(0)` means the -// same thing as [in the original API](http://nodejs.org/api/stream.html#stream_stream_read_0). +// same thing as [in the original API](https://nodejs.org/api/stream.html#stream_stream_read_0). // // * **getLastQueuedFrame(): frame**: returns the last frame in output buffers // @@ -79,7 +79,7 @@ Flow.prototype._receive = function _receive(frame, callback) { // `_receive` is called by `_write` which in turn is [called by Duplex][1] when someone `write()`s // to the flow. It emits the 'receiving' event and notifies the window size tracking code if the // incoming frame is a WINDOW_UPDATE. -// [1]: http://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback_1 +// [1]: https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback_1 Flow.prototype._write = function _write(frame, encoding, callback) { var sentToUs = (this._flowControlId === undefined) || (frame.stream === this._flowControlId); @@ -147,7 +147,7 @@ Flow.prototype._send = function _send() { // `_send` is called by `_read` which is in turn [called by Duplex][1] when it wants to have more // items in the output queue. -// [1]: http://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback_1 +// [1]: https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback_1 Flow.prototype._read = function _read() { // * if the flow control queue is empty, then let the user push more frames if (this._queue.length === 0) { diff --git a/lib/protocol/framer.js b/lib/protocol/framer.js index ca29221..244e60a 100644 --- a/lib/protocol/framer.js +++ b/lib/protocol/framer.js @@ -1,7 +1,7 @@ // The framer consists of two [Transform Stream][1] subclasses that operate in [object mode][2]: // the Serializer and the Deserializer -// [1]: http://nodejs.org/api/stream.html#stream_class_stream_transform -// [2]: http://nodejs.org/api/stream.html#stream_new_stream_readable_options +// [1]: https://nodejs.org/api/stream.html#stream_class_stream_transform +// [2]: https://nodejs.org/api/stream.html#stream_new_stream_readable_options var assert = require('assert'); var Transform = require('stream').Transform; @@ -146,10 +146,10 @@ Deserializer.prototype._transform = function _transform(chunk, encoding, done) { done(); }; -// [Frame Header](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-4.1) +// [Frame Header](https://tools.ietf.org/html/rfc7540#section-4.1) // -------------------------------------------------------------- // -// HTTP/2.0 frames share a common base format consisting of a 9-byte header followed by 0 to 2^24 - 1 +// HTTP/2 frames share a common base format consisting of a 9-byte header followed by 0 to 2^24 - 1 // bytes of data. // // Additional size limits can be set by specific application uses. HTTP limits the frame size to @@ -273,7 +273,7 @@ Deserializer.commonHeader = function readCommonHeader(buffer, frame) { // * `typeSpecificAttributes`: a register of frame specific frame object attributes (used by // logging code and also serves as documentation for frame objects) -// [DATA Frames](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.1) +// [DATA Frames](https://tools.ietf.org/html/rfc7540#section-6.1) // ------------------------------------------------------------ // // DATA frames (type=0x0) convey arbitrary, variable-length sequences of octets associated with a @@ -320,7 +320,7 @@ Deserializer.DATA = function readData(buffer, frame) { } }; -// [HEADERS](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.2) +// [HEADERS](https://tools.ietf.org/html/rfc7540#section-6.2) // -------------------------------------------------------------- // // The HEADERS frame (type=0x1) allows the sender to create a stream. @@ -418,7 +418,7 @@ Deserializer.HEADERS = function readHeadersPriority(buffer, frame) { } }; -// [PRIORITY](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.3) +// [PRIORITY](https://tools.ietf.org/html/rfc7540#section-6.3) // ------------------------------------------------------- // // The PRIORITY frame (type=0x2) specifies the sender-advised priority of a stream. @@ -467,7 +467,7 @@ Deserializer.PRIORITY = function readPriority(buffer, frame) { frame.priorityWeight = buffer.readUInt8(4); }; -// [RST_STREAM](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.4) +// [RST_STREAM](https://tools.ietf.org/html/rfc7540#section-6.4) // ----------------------------------------------------------- // // The RST_STREAM frame (type=0x3) allows for abnormal termination of a stream. @@ -509,7 +509,7 @@ Deserializer.RST_STREAM = function readRstStream(buffer, frame) { } }; -// [SETTINGS](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.5) +// [SETTINGS](https://tools.ietf.org/html/rfc7540#section-6.5) // ------------------------------------------------------- // // The SETTINGS frame (type=0x4) conveys configuration parameters that affect how endpoints @@ -616,7 +616,7 @@ definedSettings[4] = { name: 'SETTINGS_INITIAL_WINDOW_SIZE', flag: false }; // indicates the maximum size of a frame the receiver will allow. definedSettings[5] = { name: 'SETTINGS_MAX_FRAME_SIZE', flag: false }; -// [PUSH_PROMISE](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.6) +// [PUSH_PROMISE](https://tools.ietf.org/html/rfc7540#section-6.6) // --------------------------------------------------------------- // // The PUSH_PROMISE frame (type=0x5) is used to notify the peer endpoint in advance of streams the @@ -686,7 +686,7 @@ Deserializer.PUSH_PROMISE = function readPushPromise(buffer, frame) { } }; -// [PING](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.7) +// [PING](https://tools.ietf.org/html/rfc7540#section-6.7) // ----------------------------------------------- // // The PING frame (type=0x6) is a mechanism for measuring a minimal round-trip time from the @@ -716,7 +716,7 @@ Deserializer.PING = function readPing(buffer, frame) { frame.data = buffer; }; -// [GOAWAY](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.8) +// [GOAWAY](https://tools.ietf.org/html/rfc7540#section-6.8) // --------------------------------------------------- // // The GOAWAY frame (type=0x7) informs the remote peer to stop creating streams on this connection. @@ -771,7 +771,7 @@ Deserializer.GOAWAY = function readGoaway(buffer, frame) { } }; -// [WINDOW_UPDATE](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.9) +// [WINDOW_UPDATE](https://tools.ietf.org/html/rfc7540#section-6.9) // ----------------------------------------------------------------- // // The WINDOW_UPDATE frame (type=0x8) is used to implement flow control. @@ -809,7 +809,7 @@ Deserializer.WINDOW_UPDATE = function readWindowUpdate(buffer, frame) { } }; -// [CONTINUATION](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-6.10) +// [CONTINUATION](https://tools.ietf.org/html/rfc7540#section-6.10) // ------------------------------------------------------------ // // The CONTINUATION frame (type=0x9) is used to continue a sequence of header block fragments. @@ -834,7 +834,7 @@ Deserializer.CONTINUATION = function readContinuation(buffer, frame) { frame.data = buffer; }; -// [ALTSVC](http://tools.ietf.org/html/draft-ietf-httpbis-alt-svc-06#section-4) +// [ALTSVC](https://tools.ietf.org/html/rfc7838#section-4) // ------------------------------------------------------------ // // The ALTSVC frame (type=0xA) advertises the availability of an alternative service to the client. @@ -859,13 +859,13 @@ frameFlags.ALTSVC = []; // octets, of the Origin field. // // Origin: An OPTIONAL sequence of characters containing ASCII -// serialisation of an origin ([RFC6454](http://tools.ietf.org/html/rfc6454), +// serialisation of an origin ([RFC6454](https://tools.ietf.org/html/rfc6454), // Section 6.2) that the alternate service is applicable to. // // Alt-Svc-Field-Value: A sequence of octets (length determined by // subtracting the length of all preceding fields from the frame // length) containing a value identical to the Alt-Svc field value -// defined in (Section 3)[http://tools.ietf.org/html/draft-ietf-httpbis-alt-svc-06#section-3] +// defined in (Section 3)[https://tools.ietf.org/html/rfc7838#section-3] // (ABNF production "Alt-Svc"). typeSpecificAttributes.ALTSVC = ['maxAge', 'port', 'protocolID', 'host', @@ -1089,7 +1089,7 @@ Serializer.BLOCKED = function writeBlocked(frame, buffers) { Deserializer.BLOCKED = function readBlocked(buffer, frame) { }; -// [Error Codes](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-7) +// [Error Codes](https://tools.ietf.org/html/rfc7540#section-7) // ------------------------------------------------------------ var errorCodes = [ diff --git a/lib/protocol/index.js b/lib/protocol/index.js index 39f48f4..0f3720e 100644 --- a/lib/protocol/index.js +++ b/lib/protocol/index.js @@ -1,4 +1,4 @@ -// [node-http2-protocol][homepage] is an implementation of the [HTTP/2 (draft 16)][http2] +// This is an implementation of the [HTTP/2][http2] // framing layer for [node.js][node]. // // The main building blocks are [node.js streams][node-stream] that are connected through pipes. @@ -14,7 +14,7 @@ // lifecycle and settings, and responsible for enforcing the connection level limits (flow // control, initiated stream limit) // -// * [Stream](stream.html): implementation of the [HTTP/2 stream concept](http2-stream). +// * [Stream](stream.html): implementation of the [HTTP/2 stream concept][http2-stream]. // Implements the [stream state machine][http2-streamstate] defined by the standard, provides // management methods and events for using the stream (sending/receiving headers, data, etc.), // and enforces stream level constraints (flow control, sending only legal frames). @@ -27,15 +27,14 @@ // * [Serializer and Deserializer](framer.html): the lowest layer in the stack that transforms // between the binary and the JavaScript object representation of HTTP/2 frames // -// [homepage]: https://github.com/molnarg/node-http2 -// [http2]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-16 -// [http2-connheader]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-3.5 -// [http2-stream]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-5 -// [http2-streamstate]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-5.1 -// [node]: http://nodejs.org/ -// [node-stream]: http://nodejs.org/api/stream.html -// [node-https]: http://nodejs.org/api/https.html -// [node-http]: http://nodejs.org/api/http.html +// [http2]: https://tools.ietf.org/html/rfc7540 +// [http2-connheader]: https://tools.ietf.org/html/rfc7540#section-3.5 +// [http2-stream]: https://tools.ietf.org/html/rfc7540#section-5 +// [http2-streamstate]: https://tools.ietf.org/html/rfc7540#section-5.1 +// [node]: https://nodejs.org/ +// [node-stream]: https://nodejs.org/api/stream.html +// [node-https]: https://nodejs.org/api/https.html +// [node-http]: https://nodejs.org/api/http.html exports.VERSION = 'h2'; diff --git a/lib/protocol/stream.js b/lib/protocol/stream.js index b8c3cc4..6d520b9 100644 --- a/lib/protocol/stream.js +++ b/lib/protocol/stream.js @@ -3,8 +3,8 @@ var assert = require('assert'); // The Stream class // ================ -// Stream is a [Duplex stream](http://nodejs.org/api/stream.html#stream_class_stream_duplex) -// subclass that implements the [HTTP/2 Stream](http://http2.github.io/http2-spec/#rfc.section.3.4) +// Stream is a [Duplex stream](https://nodejs.org/api/stream.html#stream_class_stream_duplex) +// subclass that implements the [HTTP/2 Stream](https://tools.ietf.org/html/rfc7540#section-5) // concept. It has two 'sides': one that is used by the user to send/receive data (the `stream` // object itself) and one that is used by a Connection to read/write frames to/from the other peer // (`stream.upstream`). @@ -40,7 +40,7 @@ exports.Stream = Stream; // that are to be sent/arrived to/from the peer and are related to this stream. // // Headers are always in the [regular node.js header format][1]. -// [1]: http://nodejs.org/api/http.html#http_message_headers +// [1]: https://nodejs.org/api/http.html#http_message_headers // Constructor // ----------- @@ -182,7 +182,7 @@ Stream.prototype.altsvc = function altsvc(host, port, protocolID, maxAge, origin // [Flow](flow.html). The [Connection](connection.html) object instantiating the stream will read // and write frames to/from it. The stream itself is a regular [Duplex stream][1], and is used by // the user to write or read the body of the request. -// [1]: http://nodejs.org/api/stream.html#stream_class_stream_duplex +// [1]: https://nodejs.org/api/stream.html#stream_class_stream_duplex // upstream side stream user side // @@ -352,7 +352,7 @@ Stream.prototype._finishing = function _finishing() { } }; -// [Stream States](http://tools.ietf.org/html/draft-ietf-httpbis-http2-16#section-5.1) +// [Stream States](https://tools.ietf.org/html/rfc7540#section-5.1) // ---------------- // // +--------+ diff --git a/package.json b/package.json index e774c7e..1e73077 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "scripts": { "test": "istanbul test _mocha -- --reporter spec --slow 500 --timeout 15000", - "doc": "docco lib/* --output doc --layout parallel --css doc/docco.css" + "doc": "docco lib/* --output doc --layout parallel --template root.jst --css doc/docco.css && docco lib/protocol/* --output doc/protocol --layout parallel --template protocol.jst --css doc/docco.css" }, "repository": { "type": "git",