Thin

Tiny, fast & funny HTTP server

Thin is a Ruby web server that glues together 3 of the best Ruby libraries in web history:

* the Mongrel parser: the root of Mongrel speed and security
* Event Machine: a network I/O library with extremely high scalability, performance and stability
* Rack: a minimal interface between webservers and Ruby frameworks

Which makes it, with all humility, the most secure, stable, fast and extensible Ruby web server bundled in an easy to use gem for your own pleasure.

Installation

For the latest stable version:

sudo gem install thin

or using my mirror (might be more recent and unstable):

sudo gem install thin --source http://code.macournoyer.com

Or from source:

git clone git://github.com/macournoyer/thin.git
cd thin
rake install

Usage

A thin script is offered to easily start your Rails application:

cd to/your/rails/app
thin start

But Thin is also usable through Rack rackup command. You need to setup a config.ru file and require thin in it:

cat <<EOS
require 'thin'

app = proc do |env|
 [
   200,
   {
     'Content-Type' => 'text/html',
     'Content-Length' => '2'
   },
   ['hi']
 ]
end

run app
EOS
rackup -s thin

See example/config.ru for details and rackup -h

License

Ruby License, www.ruby-lang.org/en/LICENSE.txt.

Credits

The parser was stolen from Mongrel mongrel.rubyforge.org by Zed Shaw. Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw <zedshaw at zedshaw dot com> You can redistribute it and/or modify it under either the terms of the GPL.

Thin is copyright Marc-Andre Cournoyer <macournoyer@gmail.com>

Get help at groups.google.com/group/thin-ruby/ Report bugs at thin.lighthouseapp.com/projects/7212-thin and major security issues directly to a team member (see COMMITTERS)