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

doc: add note about browsers and HTTP/2 #19476

Closed
wants to merge 5 commits into from
Closed

Conversation

styfle
Copy link
Member

@styfle styfle commented Mar 20, 2018

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), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

Affected core subsystem(s)

doc

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. http2 Issues or PRs related to the http2 subsystem. labels Mar 20, 2018
@styfle
Copy link
Member Author

styfle commented Mar 20, 2018

/cc @apapirovski @a0viedo @mcollina @trivikr

I'm not sure the best way to word this or how to make it more explicit.
But at least if the user copy/paste code snippets now they will get the comments too.

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
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Contributor

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)

Copy link
Member Author

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).
Copy link
Member

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
Copy link
Member

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.

Copy link
Member

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?

Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed to unencrypted

@styfle
Copy link
Member Author

styfle commented Mar 20, 2018

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
Copy link
Contributor

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.

Copy link
Member Author

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
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Fixed! 🔧

@vsemozhetbyt
Copy link
Contributor

CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite/280/

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vsemozhetbyt vsemozhetbyt added the fast-track PRs that do not need to wait for 48 hours to land. label Mar 20, 2018
@vsemozhetbyt vsemozhetbyt added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 20, 2018
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.

Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okie dokie 👍

Copy link
Member

@trivikr trivikr left a 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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. (HTTP/2 Unencrypted) -> [HTTP/2 Unencrypted] (otherwise it is not rendered as a link).
  2. This and next line exceed 80 character length, so this may be a problem for doc linting

Copy link
Member Author

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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same.

@styfle
Copy link
Member Author

styfle commented Mar 20, 2018

Thanks for all the feedback! I think I got it right this time 🤞

@styfle styfle mentioned this pull request Mar 20, 2018
Copy link
Member

@trivikr trivikr left a 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

@trivikr
Copy link
Member

trivikr commented Mar 20, 2018

vsemozhetbyt pushed a commit that referenced this pull request Mar 20, 2018
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>
@vsemozhetbyt
Copy link
Contributor

Landed in cb69a7d

Thank you for the patience!

@styfle styfle deleted the patch-2 branch March 20, 2018 23:04
MylesBorins pushed a commit that referenced this pull request Mar 22, 2018
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>
@tniessen tniessen removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 24, 2018
kjin pushed a commit to kjin/node that referenced this pull request May 1, 2018
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>
MylesBorins pushed a commit that referenced this pull request May 2, 2018
Backport-PR-URL: #20456
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>
@MylesBorins MylesBorins mentioned this pull request May 2, 2018
MylesBorins pushed a commit that referenced this pull request May 15, 2018
Backport-PR-URL: #20456
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>
MylesBorins pushed a commit that referenced this pull request May 15, 2018
Backport-PR-URL: #20456
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. fast-track PRs that do not need to wait for 48 hours to land. http2 Issues or PRs related to the http2 subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants