{Net::HTTP::Server} is a pure Ruby HTTP server.
- Pure Ruby.
- Supports Streamed Request/Response Bodies.
- Supports Chunked Transfer-Encoding.
- Provides a Rack Handler.
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']]
endUse it with Rack:
require 'rack/handler/http'
Rack::Handler::HTTP.run appUsing it with rackup:
$ rackup -s HTTP$ gem install net-http-serverSee {file:LICENSE.txt} for details.