0.01
No commit activity in last 3 years
No release in over 3 years
Ruby bindings to http://github.com/ry/http-parser
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

UNMAINTAINED!

I don't work on this anymore. See this awesome fork instead: http://github.com/tmm1/http_parser.rb/

And have a nice day, please!

Ruby bindings to Ryan Dahl's http-parser

Ruby bindings to http://github.com/ry/http-parser

Usage

require "net/http/parser"

parser = Net::HTTP::RequestParser.new

parser.on_headers_complete = proc do |env|
  # Rack formatted env hash
  p env
end

parser.on_body = proc do |chunk|
  # One chunk of the body
  p chunk
end

parser.on_message_complete = proc do |env|
  # Headers and body is all parsed
  puts "Done!"
end

# Feed raw data from the socket to the parser
parser << raw_data