Base code merged to SPIN 2.4
[platform/upstream/curl.git] / lib / README.http2
1
2 HTTP2 with libcurl
3
4  Spec: http://tools.ietf.org/html/draft-ietf-httpbis-http2
5
6  Build prerequisites
7   - nghttp2
8   - OpenSSL, NSS, GnutTLS or PolarSSL with a new enough version
9
10  nghttp2 (https://github.com/tatsuhiro-t/nghttp2)
11
12   libcurl uses this 3rd party library for the low level protocol handling
13   parts. The reason for this is that HTTP2 is much more complex at that layer
14   than HTTP1.1 (which we implement on our own) and that nghttp2 is an already
15   existing and well functional library.
16
17   Right now, nghttp2 implements http2 draft-14
18
19   We require at least version 0.6.0
20
21  Over an http:// URL
22
23   If CURLOPT_HTTP_VERSION is set to CURL_HTTP_VERSION_2, libcurl will include
24   an upgrade header in the initial request to the host to allow upgrading to
25   http2.
26
27   Possibly we can later introduce an option that will cause libcurl to fail if
28   not possible to upgrade. Possibly we introduce an option that makes libcurl
29   use http2 at once over http://
30
31  Over an https:// URL
32
33   If CURLOPT_HTTP_VERSION is set to CURL_HTTP_VERSION_2, libcurl will use ALPN
34   (or NPN) to negotiate which protocol to continue with. Possibly introduce an
35   option that will cause libcurl to fail if not possible to use http2.
36   Consider options to explicitly disable ALPN and/or NPN.
37
38   ALPN is the TLS extension that http2 is expected to use. The NPN extension
39   is for a similar purpose, was made prior to ALPN and is used for SPDY so
40   early http2 servers are implemented using NPN before ALPN support is
41   widespread.
42
43 SSL libs
44
45   The challenge is the ALPN and NPN support and all our different SSL
46   backends. You may need a fairly updated SSL library version for it to
47   provide the necessary TLS features. Right now we support:
48
49     OpenSSL:  ALPN and NPN
50     NSS:      ALPN and NPN
51     GnuTLS:   ALPN
52     PolarSSL: ALPN
53
54 Alt-Svc
55
56   Alt-Svc is a suggested new header with a corresponding frame (ALTSVC) in
57   http2 that tells the client about an alternative "route" to the same content
58   for the same origin server that you get the response from. A browser or
59   long-living client can use that hint to create a new connection
60   asynchronously.  For libcurl, we may introduce a way to bring such clues to
61   the applicaton and/or let a subsequent request use the alternate route
62   automatically.
63
64 Applications
65
66   We hide http2's binary nature and convert received http2 traffic to headers
67   in HTTP 1.1 style. This allows applications to work unmodified.
68
69 curl tool
70
71   curl offers the --http2 command line option to enable use of http2
72
73 To consider:
74
75   - How to tell libcurl when using the multi interface that all or some of the
76     handles are allowed to re-use the same physical connection. Can we just
77     re-use existing pipelining logic?