diff options
author | Gil Tayar <gil@tayar.org> | 2017-08-07 19:46:07 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2017-08-10 17:40:12 +0200 |
commit | 52a0d97187f92579676dce54e05724606374c2fc (patch) | |
tree | 9acc6c99c04e19fa6fa1a8a6ced2e3f271276d12 /doc | |
parent | 66fd78e39d42e4cd8dd22d5ec3051332b40eed83 (diff) | |
download | android-node-v8-52a0d97187f92579676dce54e05724606374c2fc.tar.gz android-node-v8-52a0d97187f92579676dce54e05724606374c2fc.tar.bz2 android-node-v8-52a0d97187f92579676dce54e05724606374c2fc.zip |
doc: explain browser support of http/2 without SSL
Since browser support HTTP/2 only using SSL, the basic example
given in the docs won't work if the client is a browser.
Added a note to documentation explaining this and how to change
the code to make browser support it.
PR-URL: https://github.com/nodejs/node/pull/14670
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/api/http2.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md index 148c9f2ec3..c1264c403d 100755 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -39,6 +39,12 @@ server.on('stream', (stream, headers) => { server.listen(80); ``` +Note that the above example is an HTTP/2 server that does not support SSL. +This is significant as most browsers support HTTP/2 only with SSL. +To make the above server be able to serve content to browsers, +replace `http2.createServer()` with +`http2.createSecureServer({key: /* your SSL key */, cert: /* your SSL cert */})`. + The following illustrates an HTTP/2 client: ```js |