Skip to content

postmodern/net-http-server

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
May 22, 2011 18:01
June 18, 2022 17:10
lib
June 18, 2022 17:02
January 16, 2011 16:11
May 8, 2015 14:54
January 16, 2011 16:11
January 16, 2011 16:11
June 18, 2022 17:07
June 18, 2022 16:51
June 18, 2022 16:44
June 18, 2022 16:38
June 18, 2022 16:48

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 (c) 2011-2022 Hal Brodigan

See {file:LICENSE.txt} for details.

About

A pure Ruby HTTP Server.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages