Skip to content

Commit

Permalink
docs: Update docs related to HTTP/2
Browse files Browse the repository at this point in the history
Node's http2 module is no longer experimental.
  • Loading branch information
nwoltman committed Jun 19, 2019
1 parent 4404882 commit f116b0a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@ app.listen(3000)

HTTP/2 is the future of the web. It is faster than HTTP/1.x and comes with new, speed-boosting
features such as [server push](https://www.smashingmagazine.com/2017/04/guide-http2-server-push/).
Currently, Node.js has an `http2` module that is still in the experimental stage. The `http2`
module has a very different API from the `http`/`https` modules, but it also provides a
The Node.js `http2` module has a very different API from the `http`/`https` modules, but it also provides a
[compatibility API](https://nodejs.org/api/http2.html#http2_compatibility_api). Medley currently
uses the compatibility API (to support both HTTP/1.x and HTTP/2), but Medley's API is designed such
that when Medley upgrades to the full `http2` API, application code built on Medley should not need
to change. Medley's goal is to insulate application code from this transition (as much as possible)
so that you can start writing code now that won't require massive rewrites in the future.
so that code written now that won't require massive rewrites in the future.


## Ecosystem
Expand Down
11 changes: 4 additions & 7 deletions docs/HTTP2.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# HTTP/2

Medley offers **experimental support** for HTTP/2 starting from Node 8.8.0,
which includes HTTP/2 without a flag. Medley supports both encrypted and
unencrypted HTTP/2, but note that browsers only support encrypted HTTP/2.
Medley supports both encrypted and unencrypted HTTP/2, but note that browsers
only support encrypted HTTP/2.

### Secure (HTTPS)

Expand All @@ -28,10 +27,8 @@ app.listen(3000);
```

ALPN negotiation allows to support both HTTPS and HTTP/2 over the same socket.
Node core [`req`](Request.md#reqstream) and [`res`](Response.md#resstream)
objects can be either [HTTP/1](https://nodejs.org/api/http.html) or
[HTTP/2](https://nodejs.org/api/http2.html). To configure Medley to accept both
HTTPS and secure HTTP/2 connections, use the `allowHTTP1` option:
To configure Medley to accept both HTTPS and secure HTTP/2 connections, the
`allowHTTP1` option can be used:

```js
const app = medley({
Expand Down
5 changes: 3 additions & 2 deletions docs/Medley.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ method (when the `key` or `cert` options are present) or the
method (when the `key` and `cert` options are not present -- this is not supported by browsers).

If `true`, the HTTP server will be created to use unencrypted HTTP/2 without
any options. Note that unencrypted HTTP/2 is not supported by browsers. See
the [HTTP/2 docs](HTTP2.md) for more information.
any options. Note that unencrypted HTTP/2 is not supported by browsers.

See the [HTTP/2 docs](HTTP2.md) for more information and examples.

The `https` option is ignored if this option is present.

Expand Down

0 comments on commit f116b0a

Please sign in to comment.