README.http2 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. HTTP2 with libcurl
  2. Spec: http://tools.ietf.org/html/draft-ietf-httpbis-http2
  3. Build prerequisites
  4. - nghttp2
  5. - OpenSSL or NSS or GnutTLS with a new enough version
  6. nghttp2 (https://github.com/tatsuhiro-t/nghttp2)
  7. libcurl uses this 3rd party library for the low level protocol handling
  8. parts. The reason for this is that HTTP2 is much more complex at that layer
  9. than HTTP1.1 (which we implement on our own) and that nghttp2 is an already
  10. existing and well functional library.
  11. Right now, nghttp2 implements http2 draft-09
  12. We require at least version 0.3.0
  13. Over an http:// URL
  14. If CURLOPT_HTTP_VERSION is set to CURL_HTTP_VERSION_2, libcurl will include
  15. an upgrade header in the initial request to the host to allow upgrading to
  16. http2.
  17. Possibly we can later introduce an option that will cause libcurl to fail if
  18. not possible to upgrade. Possibly we introduce an option that makes libcurl
  19. use http2 at once over http://
  20. Over an https:// URL
  21. If CURLOPT_HTTP_VERSION is set to CURL_HTTP_VERSION_2, libcurl will use ALPN
  22. (or NPN) to negotiate which protocol to continue with. Possibly introduce an
  23. option that will cause libcurl to fail if not possible to use http2.
  24. Consider options to explicitly disable ALPN and/or NPN.
  25. ALPN is the TLS extension that http2 is expected to use. The NPN extension
  26. is for a similar purpose, was made prior to ALPN and is used for SPDY so
  27. early http2 servers are implemented using NPN before ALPN support is
  28. widespread.
  29. SSL libs
  30. The challenge is the ALPN and NPN support and all our different SSL
  31. backends. You may need a fairly updated SSL library version for it to
  32. provide the necessary TLS features. Right now we support:
  33. OpenSSL: ALPN and NPN
  34. NSS: ALPN and NPN
  35. GnuTLS: ALPN
  36. Applications
  37. We hide http2's binary nature and convert received http2 traffic to headers
  38. in HTTP 1.1 style. This allows applications to work unmodified.
  39. curl tool
  40. curl offers the --http2 command line option to enable use of http2
  41. To consider:
  42. - How to tell libcurl when using the multi interface that all or some of the
  43. handles are allowed to re-use the same physical connection. Can we just
  44. re-use existing pipelining logic?