From b19e4da3b58e4250900e5cfe18f8830fef1559cf Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 20 Mar 2018 09:06:02 -0400 Subject: [PATCH 1/5] docs: add note about browsers and HTTP/2 --- doc/api/http2.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index 13aa4d1e2103d1..b78342ac629af8 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -24,8 +24,9 @@ be emitted either by client-side code or server-side code. ### Server-side example -The following illustrates a simple, plain-text HTTP/2 server using the -Core API: +The following illustrates a simple HTTP/2 server using the Core API. +Note the use of [`http2.createSecureServer()`][] since HTTPS is required +for [most web browsers](https://caniuse.com/#feat=http2). ```js const http2 = require('http2'); @@ -252,7 +253,7 @@ and would instead register a handler for the `'stream'` event emitted by the ```js const http2 = require('http2'); -// Create a plain-text HTTP/2 server +// Create a simple HTTP/2 server const server = http2.createServer(); server.on('stream', (stream, headers) => { @@ -1730,7 +1731,9 @@ instances. ```js const http2 = require('http2'); -// Create a plain-text HTTP/2 server +// Create a simple HTTP/2 server +// This will not work in most browsers, +// Try http2.createSecureServer instead const server = http2.createServer(); server.on('stream', (stream, headers) => { From f26470d152462def2c47cf20855edf6e9fb2b0ca Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 20 Mar 2018 11:44:04 -0400 Subject: [PATCH 2/5] docs: fix hyperlink to http2 unencrypted --- doc/api/http2.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index b78342ac629af8..2eb3eb87c06d9b 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -25,8 +25,8 @@ be emitted either by client-side code or server-side code. ### Server-side example The following illustrates a simple HTTP/2 server using the Core API. -Note the use of [`http2.createSecureServer()`][] since HTTPS is required -for [most web browsers](https://caniuse.com/#feat=http2). +Since no browsers support [unencrypted HTTP/2][HTTP2 Unencrypted], +the use of [`http2.createSecureServer()`][] is preferred. ```js const http2 = require('http2'); @@ -253,7 +253,7 @@ and would instead register a handler for the `'stream'` event emitted by the ```js const http2 = require('http2'); -// Create a simple HTTP/2 server +// Create an unencrypted HTTP/2 server const server = http2.createServer(); server.on('stream', (stream, headers) => { @@ -1728,12 +1728,15 @@ changes: Returns a `net.Server` instance that creates and manages `Http2Session` instances. +Since no browsers support [unencrypted HTTP/2][HTTP2 Unencrypted], +the use of [`http2.createSecureServer()`][] is preferred. + ```js const http2 = require('http2'); -// Create a simple HTTP/2 server -// This will not work in most browsers, -// Try http2.createSecureServer instead +// Create an unencrypted HTTP/2 server. +// Since no browsers support unencrypted HTTP/2, +// the use of `http2.createSecureServer()` is preferred. const server = http2.createServer(); server.on('stream', (stream, headers) => { @@ -3088,6 +3091,7 @@ following additional properties: [Compatibility API]: #http2_compatibility_api [HTTP/1]: http.html [HTTP/2]: https://tools.ietf.org/html/rfc7540 +[HTTP2 Unencrypted]: https://http2.github.io/faq/#does-http2-require-encryption [HTTP2 Headers Object]: #http2_headers_object [HTTP2 Settings Object]: #http2_settings_object [HTTPS]: https.html @@ -3127,4 +3131,4 @@ following additional properties: [`tls.TLSSocket`]: tls.html#tls_class_tls_tlssocket [`tls.connect()`]: tls.html#tls_tls_connect_options_callback [`tls.createServer()`]: tls.html#tls_tls_createserver_options_secureconnectionlistener -[error code]: #error_codes +[error code]: #error_codes \ No newline at end of file From 9796ce3f8cbf98f04c595e0be569c4e4a21141a7 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 20 Mar 2018 12:19:25 -0400 Subject: [PATCH 3/5] doc: fix name of link --- doc/api/http2.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index 2eb3eb87c06d9b..5a526fbca2eb66 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -25,7 +25,7 @@ be emitted either by client-side code or server-side code. ### Server-side example The following illustrates a simple HTTP/2 server using the Core API. -Since no browsers support [unencrypted HTTP/2][HTTP2 Unencrypted], +Since no browsers support [unencrypted HTTP/2][HTTP/2 Unencrypted], the use of [`http2.createSecureServer()`][] is preferred. ```js @@ -1728,7 +1728,7 @@ changes: Returns a `net.Server` instance that creates and manages `Http2Session` instances. -Since no browsers support [unencrypted HTTP/2][HTTP2 Unencrypted], +Since no browsers support [unencrypted HTTP/2][HTTP/2 Unencrypted], the use of [`http2.createSecureServer()`][] is preferred. ```js @@ -3091,7 +3091,7 @@ following additional properties: [Compatibility API]: #http2_compatibility_api [HTTP/1]: http.html [HTTP/2]: https://tools.ietf.org/html/rfc7540 -[HTTP2 Unencrypted]: https://http2.github.io/faq/#does-http2-require-encryption +[HTTP/2 Unencrypted]: https://http2.github.io/faq/#does-http2-require-encryption [HTTP2 Headers Object]: #http2_headers_object [HTTP2 Settings Object]: #http2_settings_object [HTTPS]: https.html @@ -3131,4 +3131,4 @@ following additional properties: [`tls.TLSSocket`]: tls.html#tls_class_tls_tlssocket [`tls.connect()`]: tls.html#tls_tls_connect_options_callback [`tls.createServer()`]: tls.html#tls_tls_createserver_options_secureconnectionlistener -[error code]: #error_codes \ No newline at end of file +[error code]: #error_codes From c83205dcf8e9c5f497974039a879c13c383abee3 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 20 Mar 2018 14:56:06 -0400 Subject: [PATCH 4/5] doc: update comments --- doc/api/http2.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index 5a526fbca2eb66..f8facb80d762f7 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -25,8 +25,9 @@ be emitted either by client-side code or server-side code. ### Server-side example The following illustrates a simple HTTP/2 server using the Core API. -Since no browsers support [unencrypted HTTP/2][HTTP/2 Unencrypted], -the use of [`http2.createSecureServer()`][] is preferred. +Since there are no browsers known that support [unencrypted HTTP/2](HTTP/2 Unencrypted), +the use of [`http2.createSecureServer()`][] is necessary when communicating with browser +clients. ```js const http2 = require('http2'); @@ -1728,15 +1729,17 @@ changes: Returns a `net.Server` instance that creates and manages `Http2Session` instances. -Since no browsers support [unencrypted HTTP/2][HTTP/2 Unencrypted], -the use of [`http2.createSecureServer()`][] is preferred. +Since there are no browsers known that support [unencrypted HTTP/2](HTTP/2 Unencrypted), +the use of [`http2.createSecureServer()`][] is necessary when communicating with browser +clients. ```js const http2 = require('http2'); // Create an unencrypted HTTP/2 server. -// Since no browsers support unencrypted HTTP/2, -// the use of `http2.createSecureServer()` is preferred. +// Since there are no browsers known that support +// unencrypted HTTP/2, the use of `http2.createSecureServer()` +// is necessary when communicating with browser clients. const server = http2.createServer(); server.on('stream', (stream, headers) => { From 7d2ff3842d51d1031fa2dedb36c424e28e98b274 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 20 Mar 2018 16:52:50 -0400 Subject: [PATCH 5/5] doc: fix md hyperlink --- doc/api/http2.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index f8facb80d762f7..484a681eae15f9 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -25,9 +25,10 @@ be emitted either by client-side code or server-side code. ### Server-side example The following illustrates a simple HTTP/2 server using the Core API. -Since there are no browsers known that support [unencrypted HTTP/2](HTTP/2 Unencrypted), -the use of [`http2.createSecureServer()`][] is necessary when communicating with browser -clients. +Since there are no browsers known that support +[unencrypted HTTP/2][HTTP/2 Unencrypted], the use of +[`http2.createSecureServer()`][] is necessary when communicating +with browser clients. ```js const http2 = require('http2'); @@ -1729,9 +1730,10 @@ changes: Returns a `net.Server` instance that creates and manages `Http2Session` instances. -Since there are no browsers known that support [unencrypted HTTP/2](HTTP/2 Unencrypted), -the use of [`http2.createSecureServer()`][] is necessary when communicating with browser -clients. +Since there are no browsers known that support +[unencrypted HTTP/2][HTTP/2 Unencrypted], the use of +[`http2.createSecureServer()`][] is necessary when communicating +with browser clients. ```js const http2 = require('http2');