-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: add note about browsers and HTTP/2 #19476
Conversation
/cc @apapirovski @a0viedo @mcollina @trivikr I'm not sure the best way to word this or how to make it more explicit. |
doc/api/http2.md
Outdated
// Create a plain-text HTTP/2 server | ||
// Create a simple HTTP/2 server | ||
// This will not work in most browsers, | ||
// Try http2.createSecureServer instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nit: // Try
-> // try
after the comma above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any thoughts on usage of periods .
anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see what others think, I am not a native speaker)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added periods.
doc/api/http2.md
Outdated
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No browsers support unencrypted HTTP2 (HTTP/2 spec FAQ)
You can change this to "since no browsers support unencrypted HTTP2" with the link to HTTP/2 spec FAQ
Ditto for line 1735
doc/api/http2.md
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the term plain-text
is more specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using the term unencrypted
over plain-text
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be good with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me 👍
doc/api/http2.md
Outdated
@@ -1730,7 +1731,9 @@ instances. | |||
```js | |||
const http2 = require('http2'); | |||
|
|||
// Create a plain-text HTTP/2 server | |||
// Create a simple HTTP/2 server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you restore this to plain-text
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed to unencrypted
Thanks for the comments. I pushed an update with the revised docs. |
doc/api/http2.md
Outdated
@@ -3085,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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nit: we usually sort references in ASCII order, so this should go after [HTTP2 Settings Object]
ref.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this by renaming to [HTTP/2 Unencrypted]
since its not linking to a section anchor but its more like the external link above.
doc/api/http2.md
Outdated
@@ -3124,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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nit: missing line break at the end of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! Fixed! 🔧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
doc/api/http2.md
Outdated
Core API: | ||
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. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say something like...
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.
Using Unencrypted HTTP/2 would actually be the preference when running purely within internal environments with non-browser clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okie dokie 👍
doc/api/http2.md
Outdated
@@ -1727,10 +1728,15 @@ 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again,
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okie dokie 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
doc/api/http2.md
Outdated
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. | ||
Since there are no browsers known that support [unencrypted HTTP/2](HTTP/2 Unencrypted), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(HTTP/2 Unencrypted)
->[HTTP/2 Unencrypted]
(otherwise it is not rendered as a link).- This and next line exceed 80 character length, so this may be a problem for doc linting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa good catch, I just copy/pasted the code review comment so there must have been a typo.
doc/api/http2.md
Outdated
@@ -1727,10 +1729,17 @@ 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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same.
Thanks for all the feedback! I think I got it right this time 🤞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed the doc edits are appearing correctly at https://github.com/styfle/node/blob/patch-2/doc/api/http2.md
PR-URL: #19476 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in cb69a7d Thank you for the patience! |
PR-URL: #19476 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#19476 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The docs were not clear for new users of HTTP/2 requires TLS in most browsers.
This adds a couple notes to direct new users to
http2.createSecureServer()
.Fixes #19406
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
doc