Skip to content
A pure Ruby HTTP Server.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
benchmarks
lib
spec We have spec/images hosted in a different directory. May 8, 2015
.document
.gitignore
.rspec
.yardopts
ChangeLog.md
Gemfile
LICENSE.txt Initial commit. Jan 16, 2011
README.md
Rakefile
gemspec.yml
net-http-server.gemspec

README.md

net-http-server

Description

{Net::HTTP::Server} is a pure Ruby HTTP server.

Features

  • Pure Ruby.
  • Supports Streamed Request/Response Bodies.
  • Supports Chunked Transfer-Encoding.
  • Provides a Rack Handler.

Examples

Simple HTTP Server:

require 'net/http/server'
require 'pp'

Net::HTTP::Server.run(:port => 8080) do |request,stream|
  pp request

  [200, {'Content-Type' => 'text/html'}, ['Hello World']]
end

Use it with Rack:

require 'rack/handler/http'

Rack::Handler::HTTP.run app

Using it with rackup:

$ rackup -s HTTP

Requirements

Install

$ gem install net-http-server

Copyright

Copyright (c) 2011 Hal Brodigan

See {file:LICENSE.txt} for details.

Something went wrong with that request. Please try again.