Skip to content
Ruby bindings to Ryan Dahl's http-parser
C Ruby
Find file
Failed to load latest commit information.
bench Add some benchmark script.
ext Initial commit
lib/net/http Remove compiled .bundle
spec Initial commit
.gitignore Add gemspec Add note regarding better fork.
Rakefile Initial commit
ruby_http_parser.gemspec Add gemspec


I don't work on this anymore. See this awesome fork instead:

And have a nice day, please!

Ruby bindings to Ryan Dahl's http-parser

Ruby bindings to


require "net/http/parser"

parser =

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

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

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

# Feed raw data from the socket to the parser
parser << raw_data
Something went wrong with that request. Please try again.