Project

biryani

0.0
No release in over 3 years
An HTTP/2 server implemented using Ruby Ractor
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

 Project Readme

biryani

Gem Version Actions Status license

biryani is an HTTP/2 server implemented using Ruby Ractor.

Installation

The gem is available at rubygems.org. You can install it the following:

$ gem install biryani

Usage

This implementation intentionally provides a minimal API and delegates application-level responsibilities to your code. Roughly, it works as follows:

require 'socket'
require 'biryani'

port = ARGV[0] || 8888
socket = TCPServer.new(port)

server = Biryani::Server.new(
  # @param _req [Biryani::HTTPRequest]
  # @param res [Biryani::HTTPResponse]
  Ractor.shareable_proc do |_req, res|
    res.status = 200
    res.content = 'Hello, world!'
  end
)
server.run(socket)
$ curl --http2-prior-knowledge http://localhost:8888
Hello, world!

License

biryani is available as open source under the terms of the MIT License.