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: explanation for browser support of HTTP/2 #14670

Closed
wants to merge 2 commits into from
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
6 changes: 6 additions & 0 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ server.on('stream', (stream, headers) => {
server.listen(80);
```

Note that this is an HTTP server and does not support HTTPS.
Copy link
Contributor

@mscdex mscdex Aug 7, 2017

Choose a reason for hiding this comment

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

s/this/the above example/

Also, I think using the terms HTTP and HTTPS could be confusing since I would bet most people would associate those terms with HTTP 1.x?

Copy link
Member

Choose a reason for hiding this comment

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

+1 ... s/HTTP server/HTTP2 server

Copy link
Contributor

Choose a reason for hiding this comment

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

Or perhaps better yet: 'HTTP/2 server', which is used elsewhere in this document.

This is significant as most browsers support HTTP/2 only on HTTPS.
To make the above server available for browsers, replace `http2.createServer()`
with
`http2.createSecureServer({key: /* your SSL key */, cert: /* your SSL cert */})`.

The following illustrates an HTTP/2 client:

```js
Expand Down