Project

General

Profile

Feature #2813

closed

Support for HTTP/2 protocol

Added by gstrauss over 3 years ago. Updated 11 days ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:
No

Description

[continuation of #2726 filed by wild_dagger.
#2726 was accidentally associate with a different revision and subsequently was incorrectly closed]

Hello,

It is expected that the http/2 protocol is supported by lighttp ?

https://tools.ietf.org/html/rfc7540

Best regard

Wild


Related issues

Has duplicate Feature #2726: Support for HTTP/2 protocolDuplicateActions
#1

Updated by gstrauss over 3 years ago

#2

Updated by gstrauss 2 months ago

  • Status changed from New to Patch Pending
  • Priority changed from Low to Normal
  • Target version set to 1.4.56
  • ASK QUESTIONS IN Forums set to No

I am nearly ready to post to my development branch some pre-alpha code with basic HTTP/2 support, and might be ready as early as this weekend.

Are there some volunteers who would be willing to build lighttpd from source (off of my development branch)?

Please be aware that HTTP/2 support in lighttpd entails a very large set of code changes, and there are quite possibly some critical bugs (crashing, memory leaks, etc) in this pre-alpha implementation of the HTTP/2 protocol in lighttpd. This is not intended for production use.

Caveats aside, my testing thus far performs nicely with h2load and passes h2spec tests
https://nghttp2.org/documentation/h2load-howto.html
https://github.com/summerwind/h2spec

I did have to make an adjustment for h2spec tests to pass, and have filed some issues upstream for h2spec.
- https://github.com/summerwind/h2spec/issues/120
- https://github.com/summerwind/h2spec/issues/121
- https://github.com/summerwind/h2spec/issues/122

The pre-alpha HTTP/2 implementation has some limitations.
TODO: more testing
TODO: performance tuning
TODO: do something better than ignoring HTTP/2 PRIORITY (handled and discarded)
TODO: add additional debugging trace
TODO: mod_status modifications
...
future: enforce HTTP/2 requirements in TLS (or return INADEQUATE_SECURITY)
future: improve HTTP trailers support (maybe; low priority)
future: enhancements such as server-side PUSH_PROMISE (distant future; NOT IMPLEMENTED)

(If you do not want to receive email updates on this issue, please ask me to remove you from Watchers list on this issue, or you may do so yourself)

#3

Updated by gstrauss 2 months ago

HTTP/2 development in lighttpd 1.4.x: discussion started in the lighttpd Development forum at: https://redmine.lighttpd.net/boards/3/topics/9339
Let's please keep discussion on the development forum, and I'll summarize status here in the issue ticket.

I have pushed my development branch personal/gstrauss/master with support for HTTP/2.
Please refer to DevelGit for how to obtain the source code.

Please be aware that personal/gstrauss/master is my development branch, and I often edit and rewrite the git history during development.
Please git pull --rebase to fetch changes, including the rewritten history.

HTTP/2 support in lighttpd (development) can be enabled in lighttpd.conf with:
server.feature-flags += ("server.h2proto" => "enable")
For now, server.h2proto is disabled by default.

In addition to the above, Upgrade: h2c support can be enabled with
server.feature-flags += ("server.h2c" => "enable")

#4

Updated by gstrauss 12 days ago

h2spec is a conformance testing tool for HTTP/2 implementation.
https://github.com/summerwind/h2spec

Running h2spec against lighttpd requires a target file (/index.html) at least 16k+1 bytes in size (16385) or else some of the tests (which expect multiple frames) do not pass.
(documenting some manual testing from August)

While h2spec has been very useful in testing lighttpd HTTP/2 support, there are a number of shortcomings for which I have provided patches upstream.

In the meantime, lighttpd h2.c:h2_recv_headers() has a #if 0 block that sends stream PROTOCOL_ERROR instead of 400 Bad Request, and enabling the block allows lighttpd to pass all h2spec tests except for the generic/5 HPACK test (for HTTPS), and for the generic/5 HPACK test and http2/3.5 HTTP/2 Connection Preface test (for HTTP). lighttpd behavior conforms to the RFCs; these test failures
are false positives. See the links above for suggested fixes to h2spec.

h2spec -P /index.html -p 8443 -S -k -t
h2spec -P /index.html -p 8080 -S

#5

Updated by gstrauss 11 days ago

  • Status changed from Patch Pending to Fixed

HTTP/2 support has been merged to lighttpd 1.4 master branch

Also available in: Atom