Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A pure Ruby HTTP Server.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 benchmarks
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .yardopts
Octocat-spinner-32 ChangeLog.md
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 gemspec.yml
Octocat-spinner-32 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.