Plum

A minimal pure Ruby implementation of HTTP/2 library / server.
Requirements
- Ruby
- Ruby 2.2 with ALPN support patch and ECDH support patch (r51348)
- or latest Ruby 2.3.0-dev
- OpenSSL 1.0.2 or newer (HTTP/2 requires ALPN)
- Optional:
- http-parser.rb gem (HTTP/1.1 parser; if you use "http" URI scheme)
- rack gem if you use Plum as Rack server.
Usage
As a library
- See documentation: http://www.rubydoc.info/gems/plum
- See examples in
examples/ - rhenium/plum-server - A static-file server for https://rhe.jp and http://rhe.jp.
As a Rack-compatible server
Insert require "plum/rack" to your config.ru
require "plum/rack"
App = -> env {
[
200,
{ "Content-Type" => "text/plain" },
[" request: #{env["REQUEST_METHOD"]} #{env["PATH_INFO"]}"]
]
}
run App
Then run it with:
% plum -e production -p 8080 --https config.ru
By default, Plum generates a dummy server certificate if --cert and --key options are not specified.
TODO
- Better API
License
MIT License