Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: update comments
  • Loading branch information
styfle committed Mar 20, 2018
commit c83205dcf8e9c5f497974039a879c13c383abee3
15 changes: 9 additions & 6 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),

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

the use of [`http2.createSecureServer()`][] is necessary when communicating with browser
clients.

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

Choose a reason for hiding this comment

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

Okie dokie 👍

```js
const http2 = require('http2');
Expand Down Expand Up @@ -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),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The same.

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) => {
Expand Down