From 3980ca184000df31c554866a7e8dc4a775611cd6 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 10 Aug 2018 11:49:00 -0700 Subject: [PATCH] doc: clarify http2 docs around class exports Backport-PR-URL: https://github.com/nodejs/node/pull/22850 PR-URL: https://github.com/nodejs/node/pull/22247 Fixes: https://github.com/nodejs/node/issues/21434 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: George Adams Reviewed-By: Vse Mozhet Byt Reviewed-By: Trivikram Kamat --- doc/api/http2.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/api/http2.md b/doc/api/http2.md index 85b3ba4363ada5..3da544420077dc 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -108,6 +108,11 @@ have occasion to work with the `Http2Session` object directly, with most actions typically taken through interactions with either the `Http2Server` or `Http2Stream` objects. +User code will not create `Http2Session` instances directly. Server-side +`Http2Session` instances are created by the `Http2Server` instance when a +new HTTP/2 connection is received. Client-side `Http2Session` instances are +created using the `http2.connect()` method. + #### Http2Session and Sockets Every `Http2Session` instance is associated with exactly one [`net.Socket`][] or @@ -1505,6 +1510,10 @@ added: v8.4.0 * Extends: {net.Server} +Instances of `Http2Server` are created using the `http2.createServer()` +function. The `Http2Server` class is not exported directly by the `http2` +module. + #### Event: 'checkContinue'