File: http2.rst

package info (click to toggle)
hypercorn 0.17.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 908 kB
  • sloc: python: 7,839; makefile: 24; sh: 6
file content (47 lines) | stat: -rw-r--r-- 1,432 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.. _http2:

HTTP/2
======

Hypercorn is based on the excellent `hyper-h2
<https://github.com/python-hyper/hyper-h2>`_ library.

TLS settings
------------

The recommendations in this documentation for the SSL/TLS ciphers and
version are from `RFC 7540 <https://tools.ietf.org/html/rfc7540>`_. As
required in the RFC ``ECDHE+AESGCM`` is the minimal cipher set HTTP/2
and TLSv2 the minimal TLS version servers should support. By default
Hypercorn will use this as the cipher set.

ALPN Protocol
~~~~~~~~~~~~~

The ALPN Protocols should be set to include ``h2`` and ``http/1.1`` as
Hypercorn supports both. It is feasible to omit one to only serve the
other. If these aren't set most clients will assume Hypercorn is a
HTTP/1.1 only server. By default Hypercorn will set h2 and http/1.1 as
the ALPN protocols.

No-TLS
~~~~~~

Most clients, including all the web browsers only support HTTP/2 over
TLS. Hypercorn, however, supports the h2c HTTP/1.1 to HTTP/2 upgrade
process. This allows a client to send a HTTP/1.1 request with a
``Upgrade: h2c`` header that results in the connection being upgraded
to HTTP/2. To test this try

.. code-block:: shell

   $ curl --http2 http://url:port/path

Note that in the absence of either the upgrade header or an ALPN
protocol Hypercorn will assume and treat the connection as HTTP/1.1.

HTTP/2 features
---------------

Hypercorn supports pipeling, flow control, server push, and
prioritisation.