Skip to content

Commit c3886b5

Browse files
styfleMylesBorins
authored andcommitted
doc: add note about browsers and HTTP/2
PR-URL: #19476 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent cc7ba0b commit c3886b5

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

doc/api/http2.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ be emitted either by client-side code or server-side code.
2424

2525
### Server-side example
2626

27-
The following illustrates a simple, plain-text HTTP/2 server using the
28-
Core API:
27+
The following illustrates a simple HTTP/2 server using the Core API.
28+
Since there are no browsers known that support
29+
[unencrypted HTTP/2][HTTP/2 Unencrypted], the use of
30+
[`http2.createSecureServer()`][] is necessary when communicating
31+
with browser clients.
2932

3033
```js
3134
const http2 = require('http2');
@@ -253,7 +256,7 @@ and would instead register a handler for the `'stream'` event emitted by the
253256
```js
254257
const http2 = require('http2');
255258

256-
// Create a plain-text HTTP/2 server
259+
// Create an unencrypted HTTP/2 server
257260
const server = http2.createServer();
258261

259262
server.on('stream', (stream, headers) => {
@@ -1724,10 +1727,18 @@ changes:
17241727
Returns a `net.Server` instance that creates and manages `Http2Session`
17251728
instances.
17261729

1730+
Since there are no browsers known that support
1731+
[unencrypted HTTP/2][HTTP/2 Unencrypted], the use of
1732+
[`http2.createSecureServer()`][] is necessary when communicating
1733+
with browser clients.
1734+
17271735
```js
17281736
const http2 = require('http2');
17291737

1730-
// Create a plain-text HTTP/2 server
1738+
// Create an unencrypted HTTP/2 server.
1739+
// Since there are no browsers known that support
1740+
// unencrypted HTTP/2, the use of `http2.createSecureServer()`
1741+
// is necessary when communicating with browser clients.
17311742
const server = http2.createServer();
17321743

17331744
server.on('stream', (stream, headers) => {
@@ -3080,6 +3091,7 @@ following additional properties:
30803091
[Compatibility API]: #http2_compatibility_api
30813092
[HTTP/1]: http.html
30823093
[HTTP/2]: https://tools.ietf.org/html/rfc7540
3094+
[HTTP/2 Unencrypted]: https://http2.github.io/faq/#does-http2-require-encryption
30833095
[HTTP2 Headers Object]: #http2_headers_object
30843096
[HTTP2 Settings Object]: #http2_settings_object
30853097
[HTTPS]: https.html

0 commit comments

Comments
 (0)