Files
awesome-awesomeness/html/rack.html
2024-04-20 19:22:54 +02:00

2013 lines
101 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<h1 id="awesome-rack-awesome">awesome-rack <a
href="https://github.com/sindresorhus/awesome"><img
src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg"
alt="Awesome" /></a></h1>
<blockquote>
<p>A curated list of awesome Ruby rack, middlewares, frameworks and web
servers.</p>
</blockquote>
<h1 id="contents">Contents</h1>
<ul>
<li><a href="#general">General</a></li>
<li><a href="#tutorials">Tutorials</a></li>
<li><a href="#presentations">Presentations</a></li>
<li><a href="#videos">Videos</a></li>
<li><a href="#web-servers">Web Servers</a></li>
<li><a href="#frameworks">Frameworks</a></li>
<li><a href="#middlewares">Middlewares</a></li>
<li><a href="#helpers-and-tools">Helpers and Tools</a></li>
<li><a href="#miscellaneous">Miscellaneous</a></li>
<li><a href="#inspiration">Inspiration</a></li>
</ul>
<h2 id="general">General</h2>
<ul>
<li><a href="http://rack.github.io/">Rack</a> - Ruby Rack Official
website.</li>
<li><a href="https://github.com/rack/rack">Rack on GitHub</a></li>
<li><a href="https://github.com/rack/rack-contrib">rack-contrib</a> -
Contributed Rack Middleware and Utilities.</li>
<li><a href="http://www.rubydoc.info/github/rack/rack/file/SPEC">Rack
Spec</a> - Rack Interface Specification.</li>
<li><a href="https://github.com/rack/rack/wiki">Rack Wiki</a> - Has a
list of tutorals, presentations and middlewares.</li>
<li><a href="http://www.rubydoc.info/github/rack/rack/">Rack
Documentation</a> - Rack Reference Documentation.<br />
</li>
<li><a href="https://github.com/tenderlove/the_metal">the_metal</a> - A
spike for thoughts about Rack 2.0.</li>
<li><a href="https://groups.google.com/forum/#!forum/rack-devel">Rack
Development</a> - Rack Development list (Google Group).</li>
</ul>
<h2 id="tutorials">Tutorials</h2>
<ul>
<li><a
href="http://chneukirchen.org/talks/euruko-2007/neukirchen07introducingrack.pdf">Introducing
Rack</a> - An overview of Rack interface and the Rack gem by Christian
Neukirchen.</li>
<li><a href="http://rubylearning.com/blog/2013/04/02/whats-rack/">Whats
Rack</a> - A Quick Introduction to Rack .</li>
<li><a
href="http://www.ralphonrails.com/rack/2015/07/05/a-quick-note-on-rack.html">A
Quick Note on Rack</a><br />
</li>
<li><a
href="http://zaiste.net/2012/08/concisely_about_rack_applications/">Concisely
about Rack applications</a></li>
<li><a
href="http://code.tutsplus.com/tutorials/exploring-rack--net-32976">Exploring
Rack</a></li>
<li><a href="http://albertogrespan.com/blog/rack-basics/">Rack
basics</a> - Covers basic usage of Response, ERB template and the
<code>rackup</code> tool.</li>
<li><a
href="http://blog.crowdint.com/2010/11/17/rack-basics-a-rack-introduction.html">Rack
Basics - A Rack Introduction</a></li>
<li><a
href="http://codefol.io/posts/Rack-Authentication-Middleware">Rack
Authentication Middleware</a></li>
<li><a href="http://albertogrespan.com/blog/rack-middleware/">Rack
middleware</a> - Create two simple middlewares and glue it all together
using <code>Rack::Builder</code></li>
<li><a
href="http://www.blrice.net/blog/2015/09/18/a-middleware-stack-without-rack/">A
Middleware Stack Without Rack</a></li>
<li><a href="http://southdesign.de/blog/rack.html">What is Rack,
please?</a></li>
<li><a href="https://thisdata.com/blog/rack-from-the-ground-up/">Rack
from the ground up</a></li>
<li><a
href="https://devcenter.heroku.com/articles/static-sites-ruby">Creating
Static Sites in Ruby with Rack</a> - And deploy to Heroku.</li>
<li><a
href="http://nick-aschenbach.github.io/blog/2015/02/21/a-small-dsl-rack-app/">Writing
a Small DSL Using Rack</a></li>
<li><a
href="https://erikeldridge.wordpress.com/2010/02/21/simple-ruby-rack-router/">A
simple Ruby Rack router</a> - A simple router in 17 lines of code.</li>
<li><a
href="http://ixti.net/development/ruby/2011/09/03/understanding-rack-builder.html">Understanding
Rack Builder</a></li>
<li><a href="https://gist.github.com/markbates/4240848">Getting Started
with Rack</a> - Use Rack::Builder to create a simple framework that
handles HTTP GET requests.</li>
<li><a
href="https://blog.engineyard.com/2015/understanding-rack-apps-and-middleware">Understanding
Rack Apps and Middleware</a></li>
<li><a
href="http://www.blrice.net/blog/2015/05/31/make-your-own-rack-server/">Make
Your Own Rack Server</a></li>
<li><a href="http://guides.rubyonrails.org/rails_on_rack.html">Rails on
Rack</a> - Covers Rails integration with Rack and interfacing with other
Rack components. This guide tells you how to use Rack Middlewares in
your Rails applications, Action Packs internal Middleware stack and how
to define a custom Middleware stack.</li>
<li><a
href="http://pathfindersoftware.com/2009/02/its-only-rack-on-rails-but-i-like-it/">ITS
ONLY RACK ON RAILS BUT I LIKE IT</a></li>
<li><a
href="http://jnewland.github.io/articles/2008/12/16/rails-metal-a-micro-framework-with-the-power-of-rails-m/">Jesse
Newland / Rails Metal: a micro-framework with the power of
Rails</a></li>
<li><a
href="http://polycrystal.org/posts/2012-04-14-async-rack.html">Asynchronous
responses in Rack</a></li>
<li><a
href="http://www.intridea.com/blog/2012/5/24/building-streaming-rest-apis-with-ruby">Building
Streaming REST APIs with Ruby</a></li>
<li><a
href="http://files.meetup.com/437842/RackDevelopersNotebook.pdf">Rack
Developers Notebook by Bala Paranj</a></li>
<li><a
href="http://jasonseifer.com/2009/04/08/32-rack-resources-to-get-you-started">32
Rack Resources to Get You Started</a></li>
</ul>
<blockquote>
<p>Testing Rack Apps</p>
</blockquote>
<ul>
<li><a
href="http://hackers.lookout.com/2014/01/testing-rack-based-apis-with-cucumber-and-rspec/">Testing
Rack-based APIs with Cucumber and RSpec</a><br />
</li>
<li><a href="http://www.sinatrarb.com/testing.html">TESTING SINATRA WITH
RACK::TEST</a></li>
</ul>
<blockquote>
<p>Roll your own frameworks</p>
</blockquote>
<ul>
<li><a href="https://robots.thoughtbot.com/lets-build-a-sinatra">Lets
Build a Sinatra (2015)</a><br />
</li>
<li><a href="http://buildyourownsinatra.com/">EBook: Build Your Own
Sinatra by K-2052 (2015)</a><br />
</li>
<li><a href="https://rebuilding-rails.com/">Book: Rebuilding Rails by
Noah Gibbs (2013)</a></li>
<li><a href="http://owningrails.com/">Class: Owing Rails by Marc-André
Cournoyer</a> - Understand the inner working of Rails by building a
mini-version of Rails, from scratch.
<ul>
<li><a href="https://github.com/owningrails/patterns">patterns</a> -
Rails-like framework built during the Owning Rails Masterclass to
explain the design patterns behind Rails.</li>
</ul></li>
</ul>
<h2 id="presentations">Presentations</h2>
<ul>
<li><a
href="http://chneukirchen.org/talks/euruko-2007/chneukirchen-euruko2007-introducing-rack.pdf">Introducing
Rack by Christian Neukirchen at EuRuKo 2007</a> - An overview of Rack
interface and the Rack gem.</li>
<li><a href="https://speakerdeck.com/timuruski/rack-and-middleware">Rack
and Middleware by Tim Uruski 2015/Feb</a></li>
<li><a
href="http://www.slideshare.net/danwrong/8-minutes-on-rack-presentation">8
Minutes on Rack</a> - The basic introduction to the Rack application
definition.</li>
<li><a href="https://speakerdeck.com/alony/rack">Using and scaling Rack
and Rack-based middleware by alony</a></li>
<li><a href="http://www.calebwoods.com/rack-talk/">Rack talk by Caleb
Woods</a> - A overview of essential Rack built-in middlewares and rack
in Rails.</li>
<li><a
href="https://speakerdeck.com/blacktm/building-web-apps-with-rack-and-sinatra">Building
Web Apps with Rack and Sinatra by Tom Black</a></li>
<li><a
href="http://www.slideshare.net/jiang.wu/sinatra-and-friends">Sinatra
and friends by Jiang Wu</a></li>
<li><a
href="http://slideshow-s9.github.io/demos/sinatra_http_api2.html">Building
Web Services (HTTP APIs) with Ruby and Sinatra</a></li>
<li><a
href="https://speakerdeck.com/meaganewaller/ruby-on-rack-small-talk">Ruby
on Rack Small Talk by Meagan Waller</a> - Builds an example that
implements tiny MVC and a simple router. The example is available on <a
href="https://github.com/meaganewaller/ruby-on-rack-example">GitHub</a>.</li>
<li><a
href="https://speakerdeck.com/nishantmodak/rack-a-framework-to-roll-your-own">Rack:
A Framework to roll your own by Nishant Modak</a></li>
<li><a
href="https://speakerdeck.com/donschado/ruby-mvc-from-scratch-with-rack">Ruby
MVC from scratch with Rack</a> - The example code is available on the
GitHub repo <a
href="https://github.com/DonSchado/Frack-MVC">Frack-MVC</a>.</li>
<li><a
href="http://www.slideshare.net/sickill/building-web-framework-with-rack">Building
web framework with Rack</a><br />
</li>
<li><a
href="http://www.slideshare.net/oisin/constructing-web-apis-with-rack-sinatra-and-mongodb">Constructing
Web APIs with Rack, Sinatra and MongoDB by Oisin Hurley</a></li>
<li><a
href="https://speakerdeck.com/jch/streaming-apis-with-ruby">Streaming
APIs with Ruby by Jerry Cheung</a></li>
<li><a
href="https://speakerdeck.com/mitchellh/middleware-a-general-purpose-abstraction">Middleware:
A General Purpose Abstraction by Mitchell Hashimoto</a></li>
<li><a
href="https://speakerdeck.com/mirakui/high-performance-rails-long-edition">High
Performance Rails (long edition) by Issei Naruta</a> - Rails Performance
tuning and how to do profiling and caching.</li>
<li><a href="http://rofish.net/rails_single_file.pdf">A Rails App in a
Single Rackup File by Ryan Alyea</a><br />
</li>
<li><a href="http://yeahnah.org/files/rack-presentation-oct-07.pdf">Rack
- rolling your own, tiny like, web thingoes by Ryan Allen</a> - Talks
about concurrency.</li>
</ul>
<h2 id="videos">Videos</h2>
<blockquote>
<p>Videos from Railscasts</p>
</blockquote>
<ul>
<li><a
href="http://railscasts.com/episodes/53-handling-exceptions-revised">Railscasts
Pro #53 Handling Exceptions (revised)</a></li>
<li><a href="http://railscasts.com/episodes/150-rails-metal">Railscasts
— #150 Rails Metal</a></li>
<li><a
href="http://railscasts.com/episodes/150-rails-metal-revised">Railscasts
Pro #150 Rails Metal (revised)</a></li>
<li><a
href="http://railscasts.com/episodes/151-rack-middleware">Railscasts Pro
#151 Rack Middleware</a></li>
<li><a
href="http://railscasts.com/episodes/161-three-profiling-tools">Railscasts
— #161 Three Profiling Tools</a></li>
<li><a
href="http://railscasts.com/episodes/222-rack-in-rails-3">Railscasts Pro
#222 Rack in Rails 3</a></li>
<li><a
href="http://railscasts.com/episodes/247-offline-apps-part-1">Railscasts
Pro #247 Offline Apps Part 1</a></li>
<li><a
href="http://railscasts.com/episodes/248-offline-apps-part-2">Railscasts
Pro #248 Offline Apps Part 1</a></li>
<li><a
href="http://railscasts.com/episodes/260-messaging-with-faye">Railscasts
— #260 Messaging with Faye</a></li>
<li><a href="http://railscasts.com/episodes/271-resque">Railscasts —
#271 Resque</a> - <code>Rack::Auth::Basic</code> is used in this
Episode.</li>
<li><a
href="http://railscasts.com/episodes/272-markdown-with-redcarpet">Railscasts
— #272 Markdown with Redcarpet</a></li>
<li><a
href="http://railscasts.com/episodes/294-playing-with-pjax">Railscasts
Pro #294 Playing with PJAX</a></li>
<li><a
href="http://railscasts.com/episodes/305-authentication-with-warden">Railscasts
Pro #305 Authentication with Warden</a></li>
<li><a
href="http://railscasts.com/episodes/317-rack-app-from-scratch">Railscasts
Pro #317 Rack App from scratch</a></li>
<li><a
href="http://railscasts.com/episodes/319-rails-middleware-walkthrough">Railscasts
Pro #319 Rails Middleware Walkthrough</a></li>
<li><a href="http://railscasts.com/episodes/321-http-caching">Railscasts
Pro #321 HTTP Caching</a></li>
<li><a
href="http://railscasts.com/episodes/348-the-rails-api-gem">Railscasts —
#348 The Rails API Gem</a></li>
<li><a
href="http://railscasts.com/episodes/349-rails-modularity">Railscasts
Pro #349 Rails Modularity</a></li>
<li><a
href="http://railscasts.com/episodes/352-securing-an-api">Railscasts —
#352 Securing an API</a></li>
<li><a href="http://railscasts.com/episodes/357-adding-ssl">Railscasts
Pro #357 Adding SSL</a></li>
<li><a href="http://railscasts.com/episodes/368-miniprofiler">Railscasts
— #368 MiniProfiler</a></li>
<li><a
href="http://railscasts.com/episodes/395-action-controller-walkthrough">Railscasts
Pro #395 Action Controller Walkthrough</a></li>
<li><a
href="http://railscasts.com/episodes/399-autocomplete-search-terms">Railscasts
Pro #399 Autocomplete Search Terms</a></li>
<li><a
href="http://railscasts.com/episodes/414-batch-api-requests">Railscasts
Pro #414 Batch API Requests</a></li>
</ul>
<blockquote>
<p>Videos from other source</p>
</blockquote>
<ul>
<li><a href="https://www.youtube.com/watch?v=cSjRbpl8lzQ">Getting
Started with Rack by Salma Urmi</a>
<ul>
<li>See also Mark Bates article: <a
href="https://gist.github.com/markbates/4240848">Getting Started with
Rack</a></li>
</ul></li>
<li><a href="https://www.youtube.com/watch?v=NJ-ilQMsqMs">Rack
Applications and Middleware</a></li>
<li><a href="https://www.youtube.com/watch?v=iJ-ZsWtHTIg">Tekpub:
Understanding Rack</a></li>
<li><a href="https://www.youtube.com/watch?v=FV6AQEKxBOg">Using RSpec
with Rack</a></li>
<li><a href="https://www.youtube.com/watch?v=2UvpMhzkktw">Code School -
Scaling Rails Applications: Advanced HTTP Caching (Episode #10)</a> -
talks about max-age, etags, last_modified and Reverse Proxy caches.</li>
<li><a href="https://www.youtube.com/watch?v=P0aOYjoH594">Code School -
Scaling Rails Applications: Rack &amp; Metal (Episod #13)</a></li>
<li><a href="https://www.youtube.com/watch?v=i6pyhq3ZvyI">Rack
Middleware as a General Purpose Abstraction by Mitchell Hashimoto</a>
<ul>
<li>the slide is available on <a
href="https://speakerdeck.com/mitchellh/middleware-a-general-purpose-abstraction">speakerdeck</a>.</li>
<li><a href="https://github.com/mitchellh/middleware">Generalized
middleware implementation for Ruby by Mitchell Hashimoto</a> - ~ 130
LOC.</li>
</ul></li>
<li><a href="https://www.youtube.com/watch?v=uH4H5GQOSqQ">Faking Sinatra
with Rack and Middleware by Charles Wood</a></li>
<li><a href="https://www.youtube.com/watch?v=TslkdT3PfKc">Rails Conf
2013 Youve got a Sinatra on your Rails by José Valim</a> - Great look
at how Rails uses Rack internally.</li>
<li><a href="https://www.youtube.com/watch?v=m1UwxsZD6sw">RailsConf 2014
- Rack::Attack: Protect your app with this one weird gem! byAaron
Suggs</a>
<ul>
<li>the slide is available on <a
href="https://speakerdeck.com/ktheory/rack-attack-protect-your-app-with-this-one-weird-gem">speakerdeck</a></li>
</ul></li>
</ul>
<h2 id="web-servers">Web Servers</h2>
<blockquote>
<p>Rack includes handlers for these web servers:</p>
</blockquote>
<ul>
<li><a
href="https://github.com/ruby/ruby/tree/trunk/lib/webrick">WEBrick</a> -
WEBrick is an HTTP server toolkit that can be configured as an HTTPS
server, a proxy server, and a virtual-host server. It is now part of
Ruby standard library for Ruby 1.9.3.</li>
<li>FCGI</li>
<li><a href="https://github.com/ruby/ruby/tree/trunk/lib/cgi">CGI</a> -
The Common Gateway Interface (CGI) is a simple protocol for passing an
HTTP request from a web server to a standalone program, and returning
the output to the web browser.</li>
<li>SCGI</li>
<li><a href="https://github.com/macournoyer/thin/">Thin</a> - Tiny, fast
&amp; funny HTTP server. Glues together 3 of the best Ruby libraries:
The <code>Mongrel</code> parser, <code>Event Machine</code> network I/O
library and <code>Rack</code>, a minimal interface between webservers
and Ruby frameworks.</li>
<li><a
href="https://www.litespeedtech.com/products/litespeed-web-server/overview">LiteSpeed</a>
- LiteSpeed Web Server (LSWS) is a high-performance Apache drop-in
replacement, a commercial web server.</li>
</ul>
<blockquote>
<p>These web servers include Rack handlers in their distributions:</p>
</blockquote>
<ul>
<li><a
href="https://github.com/postmodern/net-http-server">net-http-server</a>
- A pure and small Ruby HTTP server.</li>
<li><a href="https://github.com/guilleiguaran/rogue">Rouge</a> - minimal
and fast HTTP 1.1 server for Rack applications, powered by
<code>EventMachine</code>, Ryan Dahls
<code>http-parser(https://github.com/joyent/http-parser)</code> and
<code>Rack::Builder</code>.</li>
<li><a href="https://github.com/gnosek/ebb">Ebb</a> - A small and fast
web server specifically for hosting dynamic web applications.</li>
<li><a href="https://github.com/KirinDave/fuzed-old">Fuzed</a> - An
integrated replacement for Mongrel+Revproxy systems in erlang.</li>
<li><a
href="https://java.net/projects/glassfish/sources/svn/show/trunk/main">GlassFish
v3</a> - An open-source application server project started by Sun
Microsystems for the Java EE platform and now sponsored by Oracle
Corporation.</li>
<li><a href="https://github.com/phusion/passenger">Phusion Passenger</a>
- A web server and application server, designed to be fast, robust and
lightweight. Supports Ruby, Python, Node.js and Meteor, and is being
used by high-profile companies such as Apple, Pixar, New York Times,
AirBnB, Juniper etc as well as over 350.000 websites. Phusion Passenger
5 (codename “Raptor”) has an innovative and optimized HTTP engine,
making it up to 4x faster than Unicorn, up to 2x faster than Puma and up
to 2x faster than Torquebox.</li>
<li><a href="https://github.com/puma/puma">Puma</a> - A simple, fast,
threaded, and highly concurrent HTTP 1.1 server writtern in Ruby.</li>
<li><a href="https://github.com/celluloid/reel">Reel</a> - A fast,
non-blocking “evented” web server written in Ruby. Youll need <a
href="https://github.com/celluloid/reel-rack">reel-rack</a>, a Rack
adapter for Reel. Reel uses <a
href="https://github.com/celluloid/celluloid">Celluloid</a>, an
Actor-based concurrent object framework for Ruby. When you create new
instances of a class, theyre actually concurrent objects, each running
<ul>
<li><a href="https://github.com/celluloid/reel-dsl/">Reel::DSL</a> -
Minimalist Reel CRUD/WS/SSE endpoint routing. Supports URI-based HTTP/S
requests, and Web Sockets &amp; Server Sent Events. Influenced by Angelo
and Sinatra.</li>
<li><a href="https://github.com/kenichi/angelo">Angelo</a> -
Sinatra-like DSL for Reel that supports WebSockets and SSE in their own
thread, called “cells” (or actors). Angelo uses Celluloid,
Celluloid::IO. Angelo replaces <a
href="https://github.com/kyledrake/sinatra-synchrony">Sinatra::Synchrony</a>
which is a very small extension for Sinatra Powered by EventMachine and
EM-Synchrony that dramatically improves the concurrency of your web
application.</li>
</ul></li>
<li><a href="http://bogomips.org/unicorn.git">Unicorn</a> - Rack HTTP
server for fast clients and Unix. Mostly wriiten in pure Ruby. Provides
<code>unicorn</code> - a rackup-like command to launch the Unicorn HTTP
server (it uses Rack::Builder DSL) and <code>unicorn_rails</code> - a
script/server-like command to launch the Unicorn HTTP server.</li>
<li><a href="https://github.com/brightroll/unixrack">unixrack</a> - A
ruby RACK webserver only for unix using the old unix style. (~500
LOC).</li>
<li><a href="https://github.com/unbit/uwsgi">uWSGI</a> - uWSGI
application server container written in Python. Supports Python (WSGI),
Ruby (Rack), Perl (PSGI), Lua (WSAPI), PHP (CGI), JVM (JWSGI), Mono
(ASP.NET plugin), GO (GCCGO), CGI Scripts.</li>
<li><a href="http://yahns.yhbt.net/">yahns</a> - Sleepy, multi-threaded,
non-blocking application server for Ruby.</li>
<li><a href="https://github.com/ianks/yars">YARS</a> - A server for your
(Rack) apps.<br />
</li>
<li><a href="https://github.com/postrank-labs/goliath">Goliath</a> - A
non-blocking Ruby web server framework. Bare metal performance, Rack API
and middleware support, simple configuration, fully asynchronous
processing, and readable and maintainable code. The framework is powered
by an EventMachine reactor, a high-performance HTTP parser and Ruby 1.9+
runtime.</li>
<li><a href="https://github.com/mongrel/mongrel">Mongrel</a> - A HTTP
library and web server written in Ruby. What makes Mongrel so fast is
the careful use of an Ragel extension to provide fast, accurate HTTP 1.1
protocol parsing.</li>
<li><a href="https://github.com/mongrel2/mongrel2">Mongrel2</a> - An
application, language, and network architecture agnostic web server that
focuses on web applications using modern browser technologies. Written
in C.<br />
</li>
<li><a href="https://github.com/basecamp/pow">Pow</a> - Zero-config Rack
server for Mac OS X. Have it serving your apps locally in under a
minute. A Linux fork is availble <a
href="https://github.com/ysbaddaden/pow">here</a>.</li>
<li><a href="https://github.com/josh/nack">nack</a> - A Rack server
built on top of the Node.js HTTP server.<br />
</li>
<li><a href="https://github.com/gmarik/gorack">Gorack</a> - A Go backed
frontend webserver for Rubys Rack applications, inspired by Nodes <a
href="http://github.com/josh/nack">nack</a>.<br />
</li>
<li><a href="https://github.com/matadon/mizuno">Mizuno</a> -
Jetty-powered running shoes for JRuby/Rack. A Rack server for JRuby. It
uses the embeddable Jetty Java servlet container. Mizuno also supports
asynchronous request handling, via the Java Servlet 3.0 asynchronous
processing mechanism.</li>
<li><a href="https://github.com/torquebox/torquebox">TorqueBox</a> -
Ruby Web &amp; Application Server built on JBoss and JRuby. TorqueBox
goes beyond providing web-centric services (supporting Rails, Rack,
Sinatra, etc), to also expose other enterprise-grade services to Ruby
applications.</li>
<li><a href="https://h2o.examp1e.net/">H2O</a> - An optimized HTTP/1,
HTTP/2 server. H2O supports Rack interface for MRuby.<br />
</li>
<li><a href="https://github.com/trinidad/trinidad">trinidad</a> - Run
Rails or Rack applications within an embedded Apache Tomcat
container.</li>
</ul>
<blockquote>
<p>Miscellaneous</p>
</blockquote>
<ul>
<li><a href="https://github.com/schacon/grack">Grack</a> - GIt Smart
HTTP Server Rack Implementation. This project aims to replace the
builtin git-http-backend CGI handler distributed with C Git with a Rack
application. This reason for doing this is to allow far more webservers
to be able to handle Git smart http requests. Grack inspired <a
href="https://github.com/dvdotsenko/git_http_backend.py">git_http_backend.py</a>
and <a href="https://github.com/yysun/Git-Web-Access">Git Web Access
(ASP.NET/IIS)</a>.</li>
</ul>
<h2 id="frameworks">Frameworks</h2>
<ul>
<li><p><a href="https://github.com/chneukirchen/rum">Rum</a> - A gRand
Unified Mapper for Rack by Christian Neukirchen. Rum apps use a small
DSL to set up the mappings. (~120 LOC)</p></li>
<li><p><a href="https://github.com/DonSchado/Frack-MVC">Frack-MVC</a> -
A small example implementation of how to build a simple MVC style
application from scratch. Check out the commit history to see how I
implemented it step-by-step. This is the example code for the slide: <a
href="https://speakerdeck.com/donschado/ruby-mvc-from-scratch-with-rack">Ruby
MVC from scratch with Rack</a></p></li>
<li><p><a href="https://github.com/patriciomacadden/hobbit">Hobbit</a> -
A minimalistic microframework built on top of Rack (thanks to
<code>Rack::Builder</code>). Hobbit is a DSL inspired by Sinatra. (~ 150
LOC).</p>
<ul>
<li><a
href="https://github.com/patriciomacadden/hobbit-contrib">hobbit-contrib</a>
- Contributed Hobbit extensions. For examples:
<code>Hobbit::Environment</code>, <code>Hobbit::ErrorHandling</code>,
<code>Hobbit::Filter</code>, <code>Hobbit::Mote</code> - render using <a
href="https://github.com/soveran/mote">mote</a>,
<code>Hobbit::Render</code>, <code>Hobbit::Session</code></li>
<li><a href="https://github.com/patriciomacadden/hat/">hat</a> - Hobby
Application Template. Combinded with i18n, rack-protection, sprockets,
tilt, better_erros, rack-test, minitest and so on.</li>
</ul></li>
<li><p><a
href="https://github.com/kentaro/mruby-hibari">mruby-hibari</a> - A Web
application framework for Web servers that support <a
href="https://github.com/mruby/mruby">mruby</a> and Rack-based API.
<code>mruby-hibari</code> currently supports the Web servers: <a
href="http://ngx.mruby.org/">ngx_mruby</a>-enabled Nginx, <a
href="http://mod.mruby.org/">mod_mruby</a>-enabled Apache and <a
href="https://h2o.examp1e.net/">h2o</a>.</p></li>
<li><p><a href="https://github.com/soveran/cuba">Cuba</a> - <a
href="https://github.com/chneukirchen/rum">Rum</a> based microframework
for web development. Integrates many templates via Tilt. Incredibly
small, less than 200 lines of code.</p>
<ul>
<li><a href="http://theguidetocuba.io/">The Guide to Cuba</a> -
following this small book to build a Twitter clone called Frogger (work
in progress).</li>
</ul></li>
<li><p><a href="https://github.com/coopermaa/dolly">Dolly</a> - Minimal
Ruby microframework inspired by Sinatra.</p></li>
<li><p><a href="https://github.com/guilleiguaran/nancy">Nancy</a> -
Minimal Ruby microframework for web development inspired in
<code>Sinatra</code> and <code>Cuba</code> (~150 LOC).</p></li>
<li><p><a href="https://github.com/guilleiguaran/rambutan">Rambutan</a>
- Ruby web microframework with Rails-ish controllers and
routes.</p></li>
<li><p><a href="https://github.com/alisnic/nyny">NYNY</a> - A
(ridiculously) small and powerful web framework (~ 300 LOC). NYNY uses
<a href="https://github.com/rails/journey">Journey</a> for
routing(Rails router). A NYNY app is a Rack middleware, it can be used
inside Sinatra, Rails, or any other Rack-based app.</p></li>
<li><p><a href="https://github.com/eldr-rb/eldr">Eldr</a> - A
lightweight, simple, modular and above all, clear framework without all
the magic. (~500 LOC). Eldr uses <a
href="https://github.com/rkh/mustermann">Mustermann</a> to build its
Router.<br />
</p></li>
<li><p><a
href="https://github.com/migrs/rack-server-pages">rack-server-pages</a>
- Rack middleware and application for serving dynamic pages in very
simple way. There are no controllers or models, just only views like a
jsp, asp and php.</p></li>
<li><p><a href="https://github.com/jlong/serve">Serve</a> - A small
Rack-based web server that makes it easy to serve HTML, ERB, Haml, or a
variety of template languages from any directory. Serve is meant to be a
lightweight version of the Views part of the Rails MVC. Serve has full
support for Rails-style partials and layouts.</p></li>
<li><p><a href="https://github.com/stjohncj/RESTRack">RESTRack</a> -
RESTRack is a Rack-based MVC framework that makes it extremely easy to
develop RESTful data services.</p>
<ul>
<li><a
href="http://github.com/stjohncj/RESTRack-Client">RESTRack-Client</a> -
A library for interacting with RESTRack based services, although it
provides a convenient API to any RESTful service.</li>
<li><a
href="http://github.com/stjohncj/RESTRack-Balancer">RESTRack-Balancer</a>
- A library for interacting with RESTful web services with automatic
load balancing across a cluster.</li>
<li><a
href="http://github.com/stjohncj/RESTRack-Splitter">RESTRack-Splitter</a>
- A library for interacting with RESTful web services with automatic
distribution across multiple nodes of a cluster.</li>
</ul></li>
<li><p><a href="https://github.com/godfat/jellyfish">jellyfish</a> -
Pico web framework for building API-centric web applications (~ 250
LOC).<br />
</p></li>
<li><p><a href="https://github.com/eddanger/junior">junior</a> - An MVC
Web Framework.</p></li>
<li><p><a href="https://github.com/zimbatm/u-web">u-web</a> - A micro
MVC framework based on Rack in a single file.</p></li>
<li><p><a href="https://github.com/kballenegger/Kenji">Kenji</a> - A
lightweight backend framework for Ruby.</p></li>
<li><p><a href="https://github.com/lifo/cramp">cramp</a> - A fully
asynchronous realtime web application framework in Ruby. It is built on
top of EventMachine.</p></li>
<li><p><a href="https://github.com/boazsegev/plezi">Plezi</a> - A
framework for realtime, RESTful, websocket web apps. (M)VC desing, BYO
models.</p></li>
<li><p><a href="https://github.com/luislavena/brooklyn">Brooklyn</a> -
Small web tool on top of Rack. No documentation.</p></li>
<li><p><a href="https://github.com/chneukirchen/coset-mirror">Coset</a>
- A framework specifically for implementing RESTful Rack applications by
Christian Neukirchen. Coset is introduced in the paper <a
href="http://chneukirchen.org/talks/euruko-2007/neukirchen07introducingrack.pdf"><code>Introducing Rack</code></a>.</p></li>
<li><p><a href="https://github.com/botanicus/rango">Rango</a> - An
ultralightweight, ultracustomizable, ultracool web framework inspired by
Django.<br />
</p></li>
<li><p><a href="https://github.com/hassox/pancake">Pancake</a> -
Construct Rack stacks as mixins. Almost all key aspects of web
frameworks are covered in Pancake as mixins to help you create your own
re-usable Rack Stacks without worrying about the really low level
plumbing.</p></li>
<li><p><a href="https://github.com/intridea/grape">Grape</a> - An
opinionated micro-framework for creating REST-like APIs in Ruby.</p>
<ul>
<li><a href="https://github.com/artsy/gris">Gris</a> - A framework for
building hypermedia API services using Grape, Roar and
ActiveRecord.</li>
</ul></li>
<li><p><a href="https://github.com/bellycard/napa">Napa</a> - Simple
framework for building Rack based APIs using Grape, Roar and
ActiveRecord.<br />
Its designed to make it easy to quickly create and deploy new API
services by providing generators, middlewares and a console similar to
what you would expect from a Rails app.</p></li>
<li><p><a href="https://github.com/crepe/crepe">Crep</a> - A lightweight
API framework designed to help you write clean, fast web services in
Ruby. With an elegant and intuitive DSL inspired by RSpec, and with a
nod to Grape, Crepe makes API design simple.</p></li>
<li><p><a href="https://github.com/rightscale/praxis">Praxis</a> - A
framework for both designing and implementing APIs.</p></li>
<li><p><a href="https://github.com/camping/camping">Camping</a> - A web
framework which consistently stays at less than 4kB of code.</p></li>
<li><p><a href="https://github.com/espresso/espresso">Espresso</a> -
Scalable Web Framework aimed at Speed and Simplicity.</p></li>
<li><p><a href="https://github.com/mtodd/halcyon">Halcyon</a> - A JSON
Web Application Framework for developing lightweight applications
interfaced via JSON-encoded HTTP requests.</p></li>
<li><p><a href="https://github.com/mneumann/wee">Wee</a> - A
light-weight, very high-level and modern web-framework that makes
<strong>W</strong>eb <strong>e</strong>ngineering
<strong>e</strong>asy<br />
</p></li>
<li><p><a href="https://github.com/markbates/mack">Mack</a> - A Ruby web
application framework. It takes the best ideas from several frameworks,
including Rails, Merb, and Ramaze.</p></li>
<li><p><a href="https://github.com/lasso/racket">Racket</a> - A small
MVC framework built on top of rack.</p></li>
<li><p><a href="https://github.com/merb/merb">Merb</a> - A web
development framework for fast, simple, and powerful
development.</p></li>
<li><p><a href="https://github.com/hanami/hanami">Hanami</a> - (formerly
Lotus) A Ruby MVC web framework comprised of many micro-libraries. It
has a simple, stable API, a minimal DSL.</p>
<ul>
<li><a
href="https://github.com/davydovanton/awesome-hanami">awesome-hanami</a>
- A collection of awesome Hanami Gems and projects.</li>
</ul></li>
<li><p><a href="https://github.com/ramaze/ramaze">Ramaze</a> - A simple,
light and modular open-source web application framework written in
Ruby.</p>
<ul>
<li><a href="https://github.com/Ramaze/ramaze-book">ramaze-book</a> -
The official book for the Ramaze web framework.</li>
</ul></li>
<li><p><a href="https://github.com/raggi/sin">Sin</a> - A multi-app
web-app DSL derived from Sinatra, riding on rack. Sin is a rebuild of
sinatra, splitting up the classes into files and going for a reusable
application class.</p></li>
<li><p><a href="https://github.com/jcasts/gin">Gin</a> - A small Ruby
web framework, built on Rack, which borrows from Sinatra expressiveness,
and targets larger applications.</p></li>
<li><p><a href="https://github.com/pakyow/pakyow/">Pakyow</a> - An
open-source framework for the modern web. Build web-based apps faster
with a view-first development process thats friendly to
everyone.</p></li>
<li><p><a href="https://github.com/Wardrop/Scorched">Scorched</a> -
Light-weight, DRY as a desert, web framework for Ruby. Simliar to
Sinatra. Scorched is a true evolutionary enhancement of Sinatra, with
more power, focus, and less clutter.</p></li>
<li><p><a href="https://github.com/rack-app/rack-app">Rack::App</a> -
Bare bone minimalistic (masochistic) pico framework for building rack
apps. Inspired by sinatra, grape and the pure use form of Rack.</p></li>
<li><p><a
href="https://github.com/apotonick/trailblazer">Trailblazer</a> - A
high-level, modular architecture for Ruby framworks with domain and form
objects, view models, twin decorators.<br />
</p></li>
<li><p><a href="https://github.com/sinatra/sinatra">Sinatra</a> - Classy
web-development dressed in a DSL for quickly creating web applications
in Ruby with minimal effort. Sinatra is not a framework, nor a MVC, its
a wrapper around Rack.</p>
<ul>
<li><a
href="https://github.com/sinatra/sinatra-contrib">sinatra-contrib</a> -
Collection of common Sinatra extensions.</li>
<li><a
href="https://github.com/sinatra/sinatra-recipes">sinatra-receipes</a> -
Community contributed recipes and techniques for the Sinatra Web
Framework.</li>
<li><a href="https://github.com/sinatra/sinatra-book">sinatra-book</a> -
A cookbook full of excellent tutorials and recipes for developing
Sinatra web applications.</li>
<li><a
href="https://en.wikipedia.org/w/index.php?title=Sinatra_(software)&amp;oldid=690374847">Frameworks
inspired by Sinatra on Wikipedia</a> - e.g.: Ruby (Padrino, Nancy), PHP
(Slim, deano), JavaScript (Express), CoffeeScript (Zappa), Python
(Flask), Go (Martini, Goji), Scala (Finatra, Scaltra), Java (Spark),
Haskell (Scotty), Bash (sh.inatra), Lua (Orbit, Mercury), Perl
(Dancer)</li>
</ul></li>
<li><p><a
href="https://github.com/padrino/padrino-framework">padrino</a> -
Padrino is a full-stack ruby framework built upon Sinatra.</p>
<ul>
<li><a
href="https://github.com/padrino/padrino-contrib">padrino-contrib</a> -
Contributed plugins and utilities for Padrino Framework.</li>
<li><a
href="https://github.com/padrino/padrino-recipes">padrino-recipes</a> -
A collection of padrino templates and plugins.</li>
</ul></li>
<li><p><a href="https://github.com/rails/rails">Rails</a> - Ruby on
Rails, is a MVC web application framework written in Ruby.</p></li>
<li><p><a href="https://github.com/voltrb/volt">Volt</a> - A reactive
web framework where your Ruby runs on both server and client (via <a
href="https://github.com/opal/opal">Opal</a>). A framework for building
data rich web applications shockingly fast. Instead of syncing data
between the client and server via HTTP, Volt uses a persistent
connection between the client and server. When data is updated on one
client, it is updated in the database and any other listening clients
(with almost no setup code needed). Volt apps share MVC and routes
between client and server. Same Ruby code runs on the client and server!
(Isomorphic App Development) Volt plans to integrate RethinkDB and
RubyMotion.</p></li>
</ul>
<h2 id="middlewares">Middlewares</h2>
<blockquote>
<p>Where you can find middlewares</p>
</blockquote>
<ul>
<li><p><a href="https://github.com/rack/rack">Rack built-in
middlewares</a>:</p>
<ul>
<li><code>Rack::Builder</code> - Implements a small DSL to iteratively
construct Rack applications.</li>
<li><code>Rack::BodyProxy</code> -</li>
<li><code>Rack::Cascade</code> - Tries a request on several apps, and
returns the first response that is not 404 or 405 (or in a list of
configurable status codes).</li>
<li><code>Rack::Chunked</code> - Middleware that applies chunked
transfer encoding to response bodies when the response does not include
a Content-Length header.<br />
</li>
<li><code>Rack::CommonLogger</code> - For creating Apache-style
logfiles.</li>
<li><code>Rack::ConditionalGet</code> - Middleware that enables
conditional GET using If-None-Match and If-Modified-Since. The
application should set either or both of the Last-Modified or Etag
response headers according to RFC 2616</li>
<li><code>Rack::Config</code> - modifies the environment using the block
given during initialization</li>
<li><code>Rack::ContentLength</code> - Sets the Content-Length header on
responses with fixed-length bodies</li>
<li><code>Rack::ContentType</code> - Sets the Content-Type header on
responses which dont have one</li>
<li><code>Rack::ETag</code> - Adds ETag header on all String bodies.
ETags are used to validate cache.</li>
<li><code>Rack::File</code> - serves files below the root directory
given, according to the path info of the Rack request. e.g. when
Rack::File.new(“/etc”) is used, you can access passwd file as
http://localhost:9292/passwd</li>
<li><code>Rack::Deflater</code> - enables compression of http responses,
currently supported compression algorithms: gzip, deflate, identy (no
transformation)</li>
<li><code>Rack::Directory</code> - serves entries below the root given,
according to the path info of the Rack request. If a directory is found,
the files contents will be presented in an html based index. If a file
is found, the env will be passed to the specified app.</li>
<li><code>Rack::ForwardRequest</code> - gets caught by
<code>Rack::Recursive</code> and redirects the current request to the
app at url</li>
<li><code>Rack::Handler</code> - <em>Handlers</em> connect web servers
with Rack. Rack includes Handlers for Thin, WEBrick, FastCGI, CGI, SCGI
and LiteSpeed. Handlers usually are activated by calling
<code>MyHandler.run(myapp)</code>. A second optional hash can be passed
to include server-specific configuration.<br />
</li>
<li><code>Rack::Head</code> - returns an empty body for all HEAD
requests. It leaves all other requests unchanged.</li>
<li><code>Rack::Lint</code> - validates your application and the
requests and responses according to the Rack spec</li>
<li><code>Rack::Lock</code> - locks every request inside a mutex, so
that every request will effectively be executed synchronously</li>
<li><code>Rack::Logger</code> - Sets up rack.logger to write to
rack.errors stream</li>
<li><code>Rack::MethodOverride</code> - Override HTTP verbs. Lets you
use HTTP verbs such as PUT or DELETE in places where the client doesnt
support it. The way this works is by letting the client do an HTTP POST
request and set the X-HTTP-Method-Override header and set the value to
the intended HTTP method (such as PATCH).</li>
<li><code>Rack::Mime</code> - Returns String with mime type if
found</li>
<li><code>Rack::NullLogger</code> -<br />
</li>
<li><code>Rack::Recursive</code> - allows applications called down the
chain to include data from other applications (by using
<code>rack['rack.recursive.include'][...]</code> or raise a
<code>ForwardRequest</code> to redirect internally</li>
<li><code>Rack::Reloader</code> - High performant source reloader</li>
<li><code>Rack::Runtime</code> - Sets an “X-Runtime” response header,
indicating the response time of the request, in seconds</li>
<li><code>Rack::Sendfile</code> - The Sendfile middleware intercepts
responses whose body is being served from a file and replaces it with a
server specific X-Sendfile header. The web server is then responsible
for writing the file contents to the client</li>
<li><code>Rack::Server</code> - Rack Server starter, used by rackup to
start a rack server and use <code>Rack::Builder</code> to construct Rack
applications.</li>
<li><code>Rack::ShowException</code> - for catching unhandled exceptions
and presenting them in a nice and helpful way with clickable
backtrace.</li>
<li><code>Rack::ShowStatus</code> catches all empty responses and
replaces them</li>
<li><code>Rack::Static</code> - intercepts requests for static files
(javascript files, images, stylesheets, etc) based on the url prefixes
or route mappings passed in the options, and serves them using a
Rack::File object. This allows a Rack stack to serve both static and
dynamic content. `</li>
<li><code>Rack::TempfileReaper</code> - Middleware tracks and cleans
Tempfiles created throughout a request (i.e. Rack::Multipart)
Ideas/strategy based on posts by Eric Wong and Charles Oliver
Nutter<br />
</li>
<li><code>Rack::URLMap</code> - takes a hash mapping urls or paths to
apps, and dispatches accordingly. Support for HTTP/1.1 host names exists
if the URLs start with <code>http://</code> or <code>https://</code>.
URLMap modifies the <code>SCRIPT_NAME</code> and <code>PATH_INFO</code>
such that the part relevant for dispatch is in the
<code>SCRIPT_NAME</code>, and the rest in the <code>PATH_INFO</code>.
This should be taken care of when you need to reconstruct the URL in
order to create links.<br />
</li>
<li><code>Rack::Utils</code> - contains a grab-bag of useful methods for
writing web applications adopted from all kinds of Ruby libraries</li>
<li><code>Rack::Multipart</code> - A multipart form data parser, adapted
from IOWA. Usually, Rack::Request#POST takes care of calling this.</li>
<li><code>Rack::Request</code> - which also provides query string
parsing and multipart handling.</li>
<li><code>Rack::Response</code> - for convenient generation of HTTP
replies and cookie handling.<br />
</li>
<li><code>Rack::MockRequest</code> and <code>Rack::MockResponse</code>-
for efficient and quick testing of Rack application without real HTTP
round-trips.</li>
<li><code>Rack::Auth::Basic</code> - implements HTTP Basic
Authentication, as per RFC 2617</li>
<li><code>Rack::Auth::Digest::MD5</code> implements the MD5 algorithm
version of HTTP Digest Authentication, as per RFC 2617.</li>
<li><code>Rack::Session::Cookie</code> - provides simple cookie based
session management. The session is a Ruby Hash stored as base64 encoded
marshalled data set to :key (default: rack.session)</li>
<li><code>Rack::Session::Pool</code> - provides simple cookie based
session management. Session data is stored in a hash held by <span
class="citation" data-cites="pool">@pool</span></li>
<li><code>Rack::Session::Memcache</code> - provides simple cookie based
session management. Session data is stored in memcached<br />
</li>
<li><em>Note that these are not middlewares</em>:
<code>Rack::BodyProxy</code>, <code>Rack::Cascade</code>,
<code>Rack::File</code>, <code>Rack::ForwardRequest</code>,
<code>Rack::Handler</code>, <code>Rack::Mime</code>,
<code>Rack::Server</code>, <code>Rack::URLMap</code>,
<code>Rack::Utils</code>, <code>Rack::Multipart</code>,
<code>Rack::Request</code>, <code>Rack::Response</code>,
<code>Rack::MockRequest</code> and <code>Rack::MockResponse</code>,</li>
</ul></li>
<li><p><a href="https://github.com/rack/rack-contrib">rack-contrib</a> -
Contributed Rack Middleware and Utilities. This package includes a
variety of add-on components for Rack:</p>
<ul>
<li><code>Rack::AcceptFormat</code> - Adds a format extension at the end
of the URI when there is none, corresponding to the mime-type given in
the Accept HTTP header.</li>
<li><code>Rack::Access</code> - Limits access based on IP address</li>
<li><code>Rack::Backstage</code> - Returns content of specified file if
it exists, which makes it convenient for putting up maintenance
pages.</li>
<li><code>Rack::CSSHTTPRequest</code> - Adds CSSHTTPRequest support by
encoding responses as CSS for cross-site AJAX-style data loading</li>
<li><code>Rack::Callbacks</code> - Implements DSL for pure before/after
filter like Middlewares.</li>
<li><code>Rack::Config</code> - Shared configuration for cooperative
middleware.</li>
<li><code>Rack::Cookies</code> - Adds simple cookie jar hash to env</li>
<li><code>Rack::Deflect</code> - Helps protect against DoS attacks.</li>
<li><code>Rack::Evil</code> - Lets the rack application return a
response to the client from any place.</li>
<li><code>Rack::HostMeta</code> - Configures <code>/host-meta</code>
using a block</li>
<li><code>Rack::JSONP</code> - Adds JSON-P support by stripping out the
callback param and padding the response with the appropriate callback
format.</li>
<li><code>Rack::LazyConditionalGet</code> - Caches a global
<code>Last-Modified</code> date and updates it each time there is a
request that is not <code>GET</code> or <code>HEAD</code>.</li>
<li><code>Rack::LighttpdScriptNameFix</code> - Fixes how lighttpd sets
the <code>SCRIPT_NAME</code> and <code>PATH_INFO</code> variables in
certain configurations.</li>
<li><code>Rack::Locale</code> - Detects the client locale using the
Accept-Language request header and sets a <code>rack.locale</code>
variable in the environment.</li>
<li><code>Rack::MailExceptions</code> - Rescues exceptions raised from
the app and sends a useful email with the exception, stacktrace, and
contents of the environment.</li>
<li><code>Rack::NestedParams</code> - parses form params with subscripts
(e.g., * “<code>post[title]=Hello</code>”) into a nested/recursive Hash
structure (based on Rails implementation).</li>
<li><code>Rack::NotFound</code> - A default 404 application.</li>
<li><code>Rack::PostBodyContentTypeParser</code> - Adds support for JSON
request bodies. The Rack parameter hash is populated by deserializing
the JSON data provided in the request body when the Content-Type is
application/json.</li>
<li><code>Rack::Printout</code> - Prints the environment and the
response per request</li>
<li><code>Rack::ProcTitle</code> - Displays request information in
process title (<code>$0</code>) for monitoring/inspection with
ps(1).</li>
<li><code>Rack::Profiler</code> - Uses ruby-prof to measure request
time.</li>
<li><code>Rack::RelativeRedirect</code> - Transforms relative paths in
redirects to absolute URLs.</li>
<li><code>Rack::ResponseCache</code> - Caches responses to requests
without query strings to Disk or a user provider Ruby object. Similar to
Rails page caching.</li>
<li><code>Rack::ResponseHeaders</code> - Manipulates response headers
object at runtime</li>
<li><code>Rack::Sendfile</code> - Enables <code>X-Sendfile</code>
support for bodies that can be served from file.</li>
<li><code>Rack::Signals</code> - Installs signal handlers that are
safely processed after a request</li>
<li><code>Rack::SimpleEndpoint</code> - Creates simple endpoints with
routing rules, similar to Sinatra actions</li>
<li><code>Rack::StaticCache</code> - Modifies the response headers to
facilitiate client and proxy caching for static files that minimizes
http requests and improves overall load times for second time
visitors.</li>
<li><code>Rack::TimeZone</code> - Detects the clients timezone using
JavaScript and sets a variable in Racks environment with the offset
from UTC.</li>
<li><code>Rack::TryStatic</code> - Tries to match request to a static
file</li>
</ul></li>
<li><p><a
href="https://github.com/rack/rack/wiki/List-of-Middleware">List of
Middleware</a> on Racks Wiki. Copied here (ver 2016/03/03):</p>
<ul>
<li><a
href="http://github.com/rack/rack-contrib/tree/master/lib/rack/contrib/jsonp.rb">JSON-P</a></li>
<li><a
href="http://github.com/rtomayko/rack-cache/tree/master">Rack::Cache</a>
is suitable as a quick drop-in component to enable HTTP caching.</li>
<li><a href="http://github.com/Qerub/rack-esi/tree/master">Rack::ESI</a>
is a small (but still very useful!) subset of ESI (Edge Side
Includes).</li>
<li><a href="http://getcloudkit.com">CloudKit</a> includes OpenIDFilter,
OAuthFilter, and RESTful JSON storage</li>
<li><a
href="http://github.com/jcrosby/rack-config/tree/master">Rack::Config</a>
- Shared configuration for cooperative middleware.</li>
<li><a
href="http://github.com/josh/rack-openid/tree/master">Rack::OpenID</a>
provides a more HTTPish API around the ruby-openid library.</li>
<li><a href="http://github.com/ddollar/rack-debug">Rack::Debug</a></li>
<li><a
href="http://github.com/mynyml/rack-abstract-format">Rack::AbstractFormat</a></li>
<li><a
href="http://github.com/mynyml/rack-respond_to">Rack::RespondTo</a>
allows triggering different actions based on requested media type.</li>
<li><a
href="http://github.com/mynyml/rack-supported-media-types">Rack::SupportedMediaTypes</a>
specify an apps supported media types.</li>
<li><a
href="http://github.com/mynyml/rack-accept-media-types">Rack::AcceptMediaTypes</a>
determine the requests prefered media type.</li>
<li><a
href="http://github.com/lucasfais/rack-multipart_related">Rack::MultipartRelated</a>
parses multipart/related requests and rebuild a simple/merged parameters
hash.</li>
<li><a
href="https://github.com/imajes/rack-heartbeat">Rack::Heartbeat</a> Add
a configurable heartbeat/health-check/ping url to your app</li>
<li><a
href="http://github.com/sunlightlabs/rack-honeypot">Rack::Honeypot</a>
acts as a spam trap.</li>
<li><a
href="http://github.com/ambethia/rack-google_analytics/tree/master">Rack::GoogleAnalytics</a>
embeds Google Analytics tracking code.</li>
<li><a href="http://github.com/minad/rack-embed">Rack::Embed</a> embeds
small images via the data-url (base64) if the browser supports it. This
reduces http traffic.</li>
<li><a href="http://github.com/hassox/warden">Warden</a> General Rack
Authentication Framework</li>
<li><a
href="http://github.com/dolzenko/rack-static_fallback">Rack::StaticFallback</a>
bounces or redirects requests to missing static files.</li>
<li><a
href="http://github.com/datagraph/rack-throttle">Rack::Throttle</a>
provides logic for rate-limiting incoming HTTP requests to Rack
applications.</li>
<li><a
href="https://github.com/ruby-rdf/rack-linkeddata">Rack::LinkedData</a>
implements Linked Data content negotiation.</li>
<li><a
href="http://github.com/mynyml/simple_router">SimpleRouter</a></li>
<li><a href="https://github.com/dmathieu/cylon">Cylon</a> Disallows
application indexation by search engines except in production. Rack
Middleware and Rails Engine.</li>
<li><a
href="https://github.com/leandrosilva/slogger">Slogger::Rack::RequestLogger</a>
if you want to log on Syslog.</li>
<li><a
href="https://github.com/crapooze/jruby-rack-batik">Rack::Batik::SVG</a>
transcodes SVG pictures to JPEG</li>
<li><a
href="https://github.com/deviantech/rack-referrals">Rack::Referrals</a>
extracts referring search engine info</li>
<li><a href="https://github.com/claco/muster">Muster</a> parses some or
all of the query string in varying formats into hashes. Helps adding
human friendly (not rack/rails nested) query string options to APIs and
such.</li>
<li><a href="https://github.com/minad/moneta">Moneta</a> adds
Rack::MonetaStore (places key/value store in env, support for
per-request caching), Rack::MonetaCookies (allow Moneta to be used to
store cookies) and Rack::MonetaRest (expose a key/value store via
HTTP/REST)</li>
<li><a
href="https://github.com/carstengehling/route_downcaser">RouteDowncaser</a>
makes all routing in Rails case-insensitive.</li>
<li><a
href="http://github.com/louismullie/rack-caniuse">Rack::CanIUse</a>
checks if user agents support the HTML/CSS technologies used by your
website using the CanIUse database.</li>
<li><a
href="https://github.com/kickstarter/rack-attack">Rack::Attack</a> A DSL
for blocking &amp; throttling abusive clients</li>
<li><a href="https://github.com/cookrn/chrome_logger">ChromeLogger</a> A
Ruby library that implements the <a
href="http://craig.is/writing/chrome-logger">Chrome Logger</a> spec as
Rack middleware</li>
<li><a
href="https://github.com/warrenguy/rack-detect-tor">Rack::DetectTor</a>
Detect Tor exit users</li>
<li><a
href="https://github.com/Gild/rack-tor-block">Rack::RackTorBlock</a>
Block access to a rack application from any client accessing from the
Tor network</li>
<li><a href="https://github.com/biola/turnout/">Rack::Turnout</a> Easily
put your Rack apps into maintenance mode</li>
<li><a href="https://github.com/biola/rack-cas">Rack::CAS</a> Simple CAS
client authentication</li>
<li><a
href="https://github.com/acorncache/acorn-cache">Rack::AcornCache</a>
Configurable HTTP proxy caching solution</li>
</ul></li>
<li><p><a href="https://rubygems.org/">Rubygems</a> - Search the
keywords <a
href="https://rubygems.org/search?utf8=%E2%9C%93&amp;query=rack"><code>rack</code></a>
or <a
href="https://rubygems.org/search?utf8=%E2%9C%93&amp;query=middleware"><code>middleware</code></a></p></li>
<li><p><a
href="https://github.com/rails/rails/tree/master/actionpack/lib/action_dispatch/middleware">Rails
ActionController Middleware Stack</a></p>
<p>To see what middleware your Rails app is using, open it up in command
line and run:</p>
<pre><code> rake middleware</code></pre>
<p>You will see a big list of middleware classes that your current Rails
app is using. A sample outout:</p>
<div class="sourceCode" id="cb2"><pre
class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">Static</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>use <span class="dt">Rack</span><span class="kw">::</span><span class="dt">Lock</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>use <span class="co">#&lt;ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007f93ff6810d8&gt;</span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>use <span class="dt">Rack</span><span class="kw">::</span><span class="dt">Runtime</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a>use <span class="dt">Rack</span><span class="kw">::</span><span class="dt">MethodOverride</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">RequestId</span></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a>use <span class="dt">Rails</span><span class="kw">::</span><span class="dt">Rack</span><span class="kw">::</span><span class="dt">Logger</span></span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">ShowExceptions</span></span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">DebugExceptions</span></span>
<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a>use <span class="dt">BetterErrors</span><span class="kw">::</span><span class="dt">Middleware</span></span>
<span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">RemoteIp</span></span>
<span id="cb2-12"><a href="#cb2-12" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">Reloader</span></span>
<span id="cb2-13"><a href="#cb2-13" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">Callbacks</span></span>
<span id="cb2-14"><a href="#cb2-14" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActiveRecord</span><span class="kw">::</span><span class="dt">ConnectionAdapters</span><span class="kw">::</span><span class="dt">ConnectionManagement</span></span>
<span id="cb2-15"><a href="#cb2-15" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActiveRecord</span><span class="kw">::</span><span class="dt">QueryCache</span></span>
<span id="cb2-16"><a href="#cb2-16" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">Cookies</span></span>
<span id="cb2-17"><a href="#cb2-17" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">Session</span><span class="kw">::</span><span class="dt">CookieStore</span></span>
<span id="cb2-18"><a href="#cb2-18" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">Flash</span></span>
<span id="cb2-19"><a href="#cb2-19" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">ParamsParser</span></span>
<span id="cb2-20"><a href="#cb2-20" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">Head</span></span>
<span id="cb2-21"><a href="#cb2-21" aria-hidden="true" tabindex="-1"></a>use <span class="dt">Rack</span><span class="kw">::</span><span class="dt">ConditionalGet</span></span>
<span id="cb2-22"><a href="#cb2-22" aria-hidden="true" tabindex="-1"></a>use <span class="dt">Rack</span><span class="kw">::</span><span class="dt">ETag</span></span>
<span id="cb2-23"><a href="#cb2-23" aria-hidden="true" tabindex="-1"></a>use <span class="dt">ActionDispatch</span><span class="kw">::</span><span class="dt">BestStandardsSupport</span></span>
<span id="cb2-24"><a href="#cb2-24" aria-hidden="true" tabindex="-1"></a>use <span class="dt">Warden</span><span class="kw">::</span><span class="dt">Manager</span></span>
<span id="cb2-25"><a href="#cb2-25" aria-hidden="true" tabindex="-1"></a>run <span class="dt">MyApplication</span><span class="kw">::</span><span class="dt">Application</span><span class="at">.routes</span></span></code></pre></div></li>
</ul>
<blockquote>
<p>Middlewares for Source Reloader</p>
</blockquote>
<ul>
<li><code>Rack::Reloader</code> from <a
href="https://github.com/rack/rack">Rack built-in middlewares</a> - High
performant source reloader</li>
<li><a href="https://github.com/rtomayko/shotgun">Shotgun</a> - An
automatic reloading version of the <code>rackup</code> command thats
shipped with Rack.</li>
<li><a
href="https://github.com/jeremyevans/rack-unreloader">rack-unreloader</a>
- A rack library that reloads application files when it detects changes,
unloading constants defined in those files before reloading</li>
<li><a href="https://github.com/dblock/guard-rack">guard-rack</a> -
Restart Rack when files change<br />
</li>
<li><code>ActionDispatch::Reloader</code> from <a
href="https://goo.gl/v8ydkH">Rails ActionController Middleware
Stack</a> - Provides prepare and cleanup callbacks, intended to assist
with code reloading during development</li>
<li><a
href="https://github.com/johnbintz/rack-livereload">rack-livereload</a>
- Bring in livereload.js into handy Rack middleware</li>
<li><a
href="https://github.com/guard/guard-livereload">guard-livereload</a> -
automatically reload your browser when view files are modified</li>
</ul>
<blockquote>
<p>Middlewares for HTTP Routing</p>
</blockquote>
<ul>
<li><p>From <a href="https://github.com/rack/rack">Rack built-in
middlewares</a>:</p>
<ul>
<li><code>Rack::URLMap</code> - to route to multiple applications inside
the same process.</li>
<li><code>Rack::Static</code> - intercepts requests for static files
(javascript files, images, stylesheets, etc) based on the url prefixes
or route mappings passed in the options, and serves them using a
Rack::File object. This allows a Rack stack to serve both static and
dynamic content. `</li>
</ul></li>
<li><p><a
href="https://github.com/logicaltext/rack-no-www">rack-no-www</a> - This
piece of simple middlweware catches requests that begin with “www” and
redirects them to the equivalent “non-www” address. For example, a
request to “http://www.example.org” will be redirected to
“http://example.org”.</p></li>
<li><p><a
href="https://github.com/iAmPlus/rack-routing">rack-routing</a> - Map
URL routes to Ruby methods</p></li>
<li><p><a
href="https://github.com/moove-it/angus-router">angus-router</a> - A
router for Rack applications.</p></li>
<li><p><a href="https://github.com/pjb3/rack-router">rack-router</a> - A
simple router for rack apps. Requires Ruby 1.9+. (~ 200 LOC)</p></li>
<li><p><a href="http://github.com/mynyml/simple_router">SimpleRouter</a>
- Small and simple standalone router, meant for use with Rack
applications. Familiar Sinatra-like DSL for defining actions. Modular
architecture.</p></li>
<li><p><a href="https://github.com/soveran/syro">Syro</a> - Simple
router for web applications inspired by Cuba. (~ 250 LOC)</p></li>
<li><p><a href="https://github.com/soveran/toro">Toro</a> - Tree
Oriented Routing<br />
</p></li>
<li><p><a
href="https://github.com/joshbuddy/http_router">http_router</a> - This
is an HTTP router for use in either a web framework, or on its own
using Rack.</p></li>
<li><p><a
href="https://github.com/brandur/sinatra-router">sinatra-router</a> - A
tiny vendorable router that makes it easy to try routes from a number of
different modular Sinatra applications<br />
</p></li>
<li><p><a
href="https://github.com/rkh/sinatra-advanced-routes">sinatra-advanced-routes</a>
- Make Sinatra routes first class objects (extracted from
BigBand).</p></li>
<li><p><a href="https://github.com/jm/rack-mount">Rack::Mount</a> - A
stackable dynamic tree based Rack router.<br />
</p></li>
<li><p><a href="https://github.com/lotus/router">Lotus::Router</a> -
Rack compatible, lightweight and fast HTTP Router for Ruby and
<code>Lotus</code>.</p></li>
<li><p><a href="https://github.com/namusyaka/pendragon">Pendragon</a> -
Provides an HTTP router for use in Rack and Padrino</p></li>
<li><p><a href="https://github.com/rails/journey">Journey</a> - A router
for rails. Journey is a router. It routes requests.</p></li>
<li><p><a href="https://github.com/joshbuddy/usher">Usher</a> - Pure
ruby general purpose router with interfaces for rails, rack, email or
choose your own adventure</p></li>
<li><p><a href="https://github.com/jeremyevans/roda">Roda</a> - Routing
Tree Web Framework Toolkit</p></li>
<li><p><a href="https://github.com/waterlink/rack-reverse-proxy">Rack
Reverse Proxy</a> - This is a simple reverse proxy for Rack that pretty
heavily rips off Rack Forwarder.</p></li>
<li><p><a
href="https://github.com/jtrupiano/rack-rewrite">Rack::Rewrite</a> - A
rack middleware for defining and applying rewrite rules<br />
</p></li>
<li><p><a href="https://github.com/hanami/router">Hanami::Router</a> -
Rack compatible, lightweight and fast HTTP Router for Ruby and
Hanami.</p></li>
</ul>
<blockquote>
<p>Middlewares for Session Management</p>
</blockquote>
<ul>
<li><p>From <a href="https://github.com/rack/rack">Rack built-in
middlewares</a>:</p>
<ul>
<li><code>Rack::Session::Abstract</code> - includes
<code>Rack::Session::Abstract::ID</code> for implementing an id based
sessioning service and <code>Rack::Session::Abstract::SessionHash</code>
for lazily loading the session from store.</li>
<li><code>Rack::Session::Cookie</code> - provides simple cookie based
session management. The session is a Ruby Hash stored as base64 encoded
marshalled data set to :key (default: rack.session)</li>
<li><code>Rack::Session::Pool</code> - provides simple cookie based
session management. Session data is stored in a hash held by <span
class="citation" data-cites="pool">@pool</span></li>
<li><code>Rack::Session::Memcache</code> - provides simple cookie based
session management. Session data is stored in memcached</li>
</ul></li>
<li><p>From <a
href="https://github.com/rails/rails/tree/master/actionpack/lib/action_dispatch/middleware">Rails
ActionController Middleware Stack</a>:</p>
<ul>
<li><code>ActionDispatch::Session::CookieStore</code> - Uses the cookie
based session store.</li>
<li><code>ActionDispatch::Session::CacheStore</code> - Uses the Rails
cache based session store</li>
<li><code>ActionDispatch::Session::MemCacheStore</code> - Uses the
memcached based session store.</li>
<li><code>ActiveRecord::SessionStore</code> - Uses the database based
session store.</li>
</ul></li>
<li><p><a
href="https://github.com/jeremyevans/rack-deadline">rack-deadline</a> -
A simple rack middleware that automatically clears sessions that have
been open too long (by default, 1 day)</p></li>
<li><p><a
href="https://github.com/railsware/rack_session_access">rack_session_access</a>
- provides rack middleware for rack.session environment
management</p></li>
<li><p><a href="https://github.com/minad/moneta">Moneta</a> - Moneta
provides a standard interface for interacting with various kinds of
key/value stores. Moneta supports the well-known NoSQL and document
based stores.</p>
<ul>
<li><code>Rack::Session::Moneta</code> - is a Rack middleware to use
Moneta for storing sessions</li>
<li><code>Rack::MonetaCookies</code> - is a Rack middleware which uses
Moneta to store cookies<br />
</li>
<li><code>ActionDispatch::Session::MonetaStore</code> - is a Rails
middleware to use Moneta for storing sessions</li>
</ul></li>
</ul>
<blockquote>
<p>Middlewares for Caching</p>
</blockquote>
<ul>
<li><p><code>Rack::ETag</code> from <a
href="https://github.com/rack/rack">Rack built-in middlewares</a> - Adds
ETag header on all String bodies. ETags are used to validate
cache.</p></li>
<li><p><a href="https://github.com/rtomayko/rack-cache">rack-cache</a> -
A quick drop-in component to enable HTTP caching for Rack-based
applications that produce freshness (Expires, Cache-Control) and/or
validation (Last-Modified, ETag) information</p></li>
<li><p><a href="https://github.com/artsy/garner">Garner</a> - A set of
Rack middleware and cache helpers that implement various caching
strategies.<br />
</p></li>
<li><p><a
href="https://github.com/eliotsykes/rack-cache-smash">rack-cache-smash</a>
- Rack middleware to cache bust <em>every</em> CSS and JS asset
request</p></li>
<li><p><a
href="https://github.com/markbates/rack-cachely">Rack::Cachely</a> -
Rack Middleware for working with the CachelyApp Page Cache Service, <a
href="http://www.cachelyapp.com/">Cachely</a></p></li>
<li><p><a
href="https://github.com/plataformatec/faraday-http-cache">Faraday Http
Cache</a> - A Faraday middleware that respects HTTP cache, by checking
expiration and validation of the stored responses.</p></li>
<li><p><a
href="https://github.com/csquared/rack-worker">Rack::Worker</a> - Rack
middleware that implements the Worker Pattern. It processes GET requests
with a worker backend and only serves them straight from a cache. While
processing the request it serves empty HTTP 202 responses. Your web
frontend is never blocked processing the request.<br />
</p></li>
<li><p><a href="https://github.com/minad/moneta">Moneta</a> - Moneta
provides a standard interface for interacting with various kinds of
key/value stores. Moneta supports the well-known NoSQL and document
based stores.</p>
<ul>
<li><code>Rack::MonetaStore</code> - is a Rack middleware which places a
Moneta store in the environment and enables per-request caching</li>
<li><code>Rack::Cache::Moneta</code> - provides meta and entity stores
for Rack-Cache</li>
<li><code>ActiveSupport::Cache::MonetaStore</code> - is a Rails cache
implementation which uses a Moneta store as backend</li>
<li><code>Ramaze::Cache::Moneta</code> - is integrated into the Ramaze
project and allows Ramaze to use Moneta as caching store</li>
</ul></li>
</ul>
<blockquote>
<p>Middlewares for Authentication</p>
</blockquote>
<ul>
<li><code>Rack::Auth::Basic</code> and <code>Rack::Auth::Digest</code>
from <a href="https://github.com/rack/rack">Rack built-in
middlewares</a> - HTTP Basic Authentication and HTTP Digest
Authentication</li>
<li><a href="https://github.com/hassox/warden">Warden</a> - General Rack
Authentication Framework</li>
<li><a href="https://github.com/plataformatec/devise">Devise</a> - A
flexible authentication solution for Rails based on Warden. A complete
MVC solution based on Rails engines</li>
<li><a href="https://github.com/intridea/omniauth">OmniAuth</a> - A
flexible authentication system utilizing Rack middleware</li>
<li><a href="https://github.com/nov/rack-oauth2">rack-oauth2</a> - OAuth
2.0 Server &amp; Client Library. Both Bearer and MAC token type are
supported.</li>
<li><a
href="https://github.com/assaf/rack-oauth2-server">Rack::OAuth2::Server</a>
- OAuth 2.0 Authorization Server as a Rack module. Supports Sinatra and
Rails.</li>
<li><a href="https://github.com/grosser/rack-openid">rack-openid</a> -
Provides a more HTTPish API around the <code>ruby-openid</code>
library</li>
<li><a
href="https://github.com/botanicus/rack-jwt-token-auth">rack-jwt-token-auth</a>
- JWT-based token authentication middleware for Rack.</li>
<li><a href="https://github.com/cyx/shield">Shield</a> - Authentication
protocol for use in your routing and model context (~ 110 LOC)</li>
<li><a href="https://github.com/heroku/heroku-bouncer">Heroku
Bouncer</a> - Rack middleware (implemented in Sinatra) that requires
Heroku OAuth on all requests.<br />
</li>
<li><a
href="https://github.com/atmos/sinatra_auth_github">sinatra_auth_github</a>
- A sinatra extension that provides oauth authentication to github. See
Scott Chacons <a
href="https://github.com/schacon/ghapp.sinatra.min">Minimal Sinatra
GitHub Application</a> for a demostration.<br />
</li>
<li><a
href="https://github.com/intridea/rack_facebook_connect">Rack::FacebookConnect</a>
- A Rack middleware for Facebook Connect authentication.</li>
<li><a href="https://github.com/mig-hub/cerberus">Rack::Cerberus</a> -
Rack middleware for form-based authentication. It works roughly like
Basic HTTP authentication except that you can use options in order to
style the authentication page.</li>
<li><a href="https://github.com/atmos/hancock/">hancock</a> - An OpenID
based Single Sign On server with a simple API, written in Sinatra
<ul>
<li><a href="https://github.com/atmos/hancock-client">hancock-client</a>
- A sinatra app and rack middleware piece for the hancock SSO
server</li>
</ul></li>
<li><a href="https://github.com/rekado/ntlm-sso">ntlm-sso</a> - Rack
authentication module for single sign on via NTLM. Note this is not a
middleware.</li>
<li><a href="https://github.com/rbCAS/CASino">CASino</a> - Ruby-based
Single Sign-On solution supporting the CAS standard. Note this is not a
middleware.
<ul>
<li><a href="https://github.com/rbCAS/CASinoApp">CASinoApp</a> - Ready
to use CAS server based on CASino Rails Engine.</li>
</ul></li>
<li><a href="https://github.com/omniauth/omniauth">OmniAuth</a> - A
flexible authentication system utilizing Rack middleware.</li>
</ul>
<blockquote>
<p>Middlwares for Asset Pipeline</p>
</blockquote>
<ul>
<li><a href="https://github.com/rails/sprockets">Sprockets</a> -
Sprockets is a Ruby library for compiling and serving web assets. It
features declarative dependency management for JavaScript and CSS
assets, as well as a powerful preprocessor pipeline that allows you to
write assets in languages like CoffeeScript, Sass and SCSS.</li>
<li><a
href="https://github.com/petebrowne/rack-sprocketize">rack-sprocketize</a>
- a piece of Rack Middleware which uses Sprockets to concatenate
javascript files and then optionally compresses them.</li>
<li><a href="https://github.com/petebrowne/rack-pack">rack-pack</a> - A
piece of Rack Middleware that packages and optionally compresses assets
such as javascripts and stylesheets into single files.</li>
<li><a href="https://github.com/ujifgc/rack-pipeline">Rack Pipeline</a>
- A rack middleware to serve javascript and stylesheet assets for ruby
web applications</li>
<li><a href="https://github.com/mattly/rack-coffee">rack-coffee</a> -
Simple rack middleware for serving up <code>CoffeeScript</code> files as
compiled javascript</li>
<li><a href="https://github.com/logicaltext/rack-bundle">rack-bundle</a>
- A Rack middleware for grouping Javascripts and stylesheets into one
single file (styles are grouped by media type).<br />
</li>
<li><a href="https://github.com/eliotsykes/rack-zippy">rack-zippy</a> -
A Rack middleware for serving static gzipped assets precompiled by the
Rails (4.1 and earlier) asset pipeline into the public/assets
directory.</li>
<li><a href="https://github.com/sstephenson/hork">Hork</a> - Rack
middleware for transparently compressing JavaScript and CSS assets with
the YUI Compressor<br />
</li>
<li><a href="https://github.com/rstacruz/sinatra-assetpack">Sinatra
AssetPack</a> - The most convenient way to manage your assets in
Sinatra</li>
<li><a
href="https://github.com/jbaudanza/rack-asset-compiler">rack-asset-compiler</a>
- Rack middleware that provides a generic interface for compiling static
files, such as Sass or CoffeeScript files.</li>
<li><a href="https://github.com/ncr/rack-cat">Rack::Cat</a> - A Rack
middleware to concatenate your assets (static, dynamic and remote) and
serve javascripts and stylesheets faster.</li>
<li><a href="https://github.com/petebrowne/rack-pack">Rack::Pack</a> -
for packaging assets such as javascripts and stylesheets into a single
file.</li>
</ul>
<blockquote>
<p>Middlewares for Debugging or Profiling</p>
</blockquote>
<ul>
<li><p>From <a href="https://github.com/rack/rack">Rack built-in
middlewares</a>:</p>
<ul>
<li><code>Rack::ShowException</code> - for catching unhandled exceptions
and presenting them in a nice and helpful way with clickable
backtrace.</li>
<li><code>Rack::ShowStatus</code> catches all empty responses and
replaces them with a site explaining the error<br />
</li>
<li><code>Rack::Runtime</code> sets an “X-Runtime” response header,
indicating the response time of the request, in seconds</li>
</ul></li>
<li><p>From <a
href="https://github.com/rails/rails/tree/master/actionpack/lib/action_dispatch/middleware">Rails
ActionController Middleware Stack</a>:</p>
<ul>
<li><code>ActionDispatch::ShowExceptions</code> - Rescues any exception
returned by the application and calls an exceptions app that will wrap
it in a format for the end user.</li>
<li><code>ActionDispatch::DebugExceptions</code> - Responsible for
logging exceptions and showing a debugging page in case the request is
local.</li>
</ul></li>
<li><p><a
href="https://github.com/codegram/rack-webconsole">rack-webconsole</a> -
Rack-based interactive console (ana Rails console) in your web
applications frontend. That means you can interact with your
applications backend from within the browser itself!</p></li>
<li><p><a
href="https://github.com/mrbrdo/rack-webconsole">rack-webconsole-pry</a>
- based on <a
href="https://github.com/codegram/rack-webconsole"><code>rack-webconsole</code></a>,
uses <a href="https://github.com/pry/pry"><code>pry</code></a> instead
of ripl, supports colors.</p></li>
<li><p><a
href="https://github.com/ConradIrwin/pry-rescue">PryRescue::Rack</a> -
pry-rescue is an implementation of “break on unhandled exception” for
Ruby. Whenever an exception is raised, but not rescued, pry-rescue will
automatically open Pry for you.</p></li>
<li><p><a href="https://github.com/brynary/rack-bug">rack-bug</a> -
<code>Rack::Bug</code> adds a diagnostics toolbar to Rack apps. When
enabled, it injects a floating div allowing exploration of logging,
database queries, template rendering times, etc.</p></li>
<li><p><a href="https://github.com/ddollar/rack-debug">rack-debug</a> -
A middleware that provides a simple interface to
<code>ruby-debug</code>. Helps debug apps running in Passenger<br />
</p></li>
<li><p><a
href="https://github.com/pboling/rack-insight">rack-insight</a> -
<code>Rack::Insight</code> adds a diagnostics toolbar to Rack apps. When
enabled, it injects a floating div allowing exploration of logging,
database queries, template rendering times, etc.
<code>Rack::Insight</code> stores debugging info over many requests,
incuding AJAX requests. Forked from <code>rack-bug</code></p></li>
<li><p><a href="https://github.com/sickill/racksh">racksh</a> - Console
for Rack based ruby web apps. Its like script/console in Rails (~ 100
LOC) or merb -i in Merb, but for any app built on Rack. Thanks to
<code>Rack::Test::Methods</code> (from <code>rack-test</code>) and Ruby
REPLs (<code>pry</code> and <code>irb</code>).</p></li>
<li><p><a href="https://github.com/pka/rack-monitor">rack-monitor</a> -
Rack middleware for collecting run-time information for monitoring tools
like Munin</p></li>
<li><p><a
href="https://github.com/bhb/rack-perftools_profiler">Rack::PerftoolsProfiler</a>
- Middleware for profiling Rack-compatible apps using <a
href="http://github.com/tmm1/perftools.rb">perftools.rb</a></p></li>
<li><p><a href="https://github.com/bugsnag/bugsnag-ruby">Bugsnag</a> -
The Bugsnag Notifier for Ruby gives you instant notification of
exceptions thrown from your Rails, Sinatra, Rack or plain Ruby
app</p></li>
<li><p><a href="https://github.com/charliesome/better_errors">Better
Errors</a> - Better Errors replaces the standard Rails error page with a
much better and more useful error page. It is also usable outside of
Rails in any Rack app as Rack middleware.</p></li>
<li><p><a
href="https://github.com/MiniProfiler/rack-mini-profiler">rack-mini-profiler</a>
- Middleware that displays speed badge for every html page. A simple but
effective mini-profiler for .NET, Ruby, Go and Node.js. Introduced in <a
href="http://railscasts.com/episodes/368-miniprofiler"><code>Railscasts #368 MiniProfiler</code></a></p></li>
<li><p><a href="https://github.com/newrelic/rpm">New Relic RPM Ruby
Agent</a> - New Relic is a performance management system. It provides
you with deep information about the performance of your Rails or Ruby
application as it runs in production. When running in developer mode,
the New Relic Ruby Agent acts as a Rack middleware that maps /newrelic
to an application for showing detailed performance metrics on a page by
page basis. Installed automatically in Rails applications<br />
</p></li>
<li><p><a
href="https://github.com/airbrake/airbrake/blob/master/lib/airbrake/rack/middleware.rb">Airbrake::Rack::Middleware</a>
- Airbrake Rack middleware for Rails and Sinatra applications (or any
other Rack-compliant app). Any errors raised by the upstream application
will be delivered to Airbrake and re-raised.</p></li>
</ul>
<blockquote>
<p>Middlewares for Protection</p>
</blockquote>
<ul>
<li><a
href="https://github.com/sinatra/rack-protection">rack-protection</a> -
This gem protects against typical web attacks. Prevented Attacks
includes <code>Cross Site Request Forgery</code>,
<code>Cross Site Scripting</code>, <code>Clickjacking</code>,
<code>Directory Traversal</code>, <code>Session Hijacking</code>,
<code>IP Spoofing</code>. Note: This project has been merged upstream to
sinatra/sinatra.</li>
<li><a href="https://github.com/kickstarter/rack-attack">rack-attack</a>
- Rack middleware for blocking &amp; throttling abusive requests. It
allows whitelisting, blacklisting, throttling, and tracking based on
arbitrary properties of the request.<br />
</li>
<li><a href="https://github.com/udzura/rack-block">rack-block</a> - A
rack middleware for controlling accesses by search bot or not, remote ip
address, etc.<br />
</li>
<li><a href="https://github.com/Gild/rack-tor-block">rack-tor-block</a>
- A rack middleware to block accesses to your rails application from TOR
nodes. Inspired by <code>rack-block</code></li>
<li><code>ActionDispatch::RemoteIp</code> from <a
href="https://github.com/rails/rails/tree/master/actionpack/lib/action_dispatch/middleware">Rails
ActionController Middleware Stack</a> - Checks for IP spoofing
attacks.</li>
<li><a
href="https://github.com/bendiken/rack-throttle">Rack::Throttle</a> -
provides logic for rate-limiting incoming HTTP requests to Rack
applications.</li>
<li><a href="https://github.com/jeffchao/alpaca">Alpaca</a> - allows
developers to quickly and easily configure and manage a whitelist and/or
blacklist</li>
<li><a href="https://github.com/TU-Berlin-SNET/tctp-rack">Rack TCTP</a>
- middleware for enabling end-to-end security using the Trusted Cloud
Transfer Protocol (TCTP)</li>
</ul>
<blockquote>
<p>Middlewares for WebSocket</p>
</blockquote>
<ul>
<li><a
href="https://github.com/imanel/websocket-rack">faye-websocket-ruby</a>
- Standards-compliant WebSocket client and server. A general-purpose
WebSocket implementation extracted from the <a
href="http://faye.jcoglan.com/">Faye</a> project</li>
<li><a
href="https://github.com/imanel/websocket-rack">websocket-rack</a> -
Rack-based WebSocket server</li>
<li><a
href="https://github.com/simulacre/sinatra-websocket">SinatraWebsocket</a>
- Makes it easy to upgrade any request to a websocket connection in
Sinatra</li>
</ul>
<blockquote>
<p>Middlewares for SEO</p>
</blockquote>
<ul>
<li><a href="https://github.com/seojs/seojs-ruby">seojs-ruby</a> - Rack
middleware to integrate SEO.js to your Rails or Sinatra app. SEO.js
makes your BackboneJS, AngularJS or EmberJS apps crawlable by Google to
make them appear in search results</li>
<li><a href="https://github.com/xavriley/rack-seo">Rack SEO</a> -
Generate SEO friendly meta tags on the fly using Rack Middleware</li>
</ul>
<blockquote>
<p>Miscellaneous Middlewares</p>
</blockquote>
<ul>
<li><a
href="https://github.com/leejarvis/rack-pygmentize">rack-pygmentize</a>
- use the generic syntax highlighter Pygments library to make your code
look pretty!</li>
<li><a href="https://github.com/treeder/rack-flash">rack-flash</a> -
Simple flash hash implementation for Rack apps.</li>
<li><a href="https://github.com/SFEley/sinatra-flash">sinatra-flash</a>
- An implementation of show-em-once flash messages for the Sinatra
Web framework. (~ 50 LOC, note this is not a middleware.)<br />
</li>
<li><a
href="https://github.com/johnbintz/rack-emstream">rack-emstream</a> -
Simple middleware for streaming with EventMachine-capable servers</li>
<li><a href="https://github.com/macournoyer/sc">sc</a> - If static site
generators were vegies, this one would be a pickle.</li>
<li><a href="https://github.com/petebrowne/machined">machined</a> - A
static site generator and Rack server built using Sprockets 2.0</li>
<li><a href="https://github.com/adaoraul/rack-jekyll">rack-jekyll</a> -
Transform your <a href="http://github.com/mojombo/jekyll">Jekyll</a> app
into Rack application</li>
<li><a href="https://github.com/middleman/middleman">Middleman</a> - A
static site generator using all the shortcuts and tools in modern web
development. You can use Rack middlewares to modify content on-the-fly
and intercept requests before they are processed by the server
(Middleman). Middleman itslef has Rack middlewares to minify CSS and
JavaScript files.</li>
<li><a href="https://github.com/sstephenson/brochure">Brochure</a> -
Rack application for serving static sites with ERB templates (or any of
the many template languages supported by Tilt)</li>
<li><a href="https://github.com/karmi/marley">Marley</a> - A minimal
blog engine without admin interface written in Sinatra framework. Use
Rack::Auth::Basic to provide authentication.<br />
</li>
<li><a href="https://github.com/chopmo/rack-ssl">rack-ssl</a> - Rack
middleware to force SSL</li>
<li><a
href="https://github.com/tobmatth/rack-ssl-enforcer">rack-ssl-enforcer</a>
- A simple Rack middleware to enforce ssl connections</li>
<li><a
href="https://github.com/jstorimer/rack-ssl-rails">rack-ssl-rails</a> -
A simple interface to <code>Rack::SSL</code> for Rails. Provides a
railtie for use with rack-ssl</li>
<li><a
href="https://github.com/mallowlabs/heroku-rack-ssl-enforcer-rails">heroku-rack-ssl-enforcer-rails</a>
- Enforce SSL on Rails application on Heroku</li>
<li><a href="https://github.com/polleverywhere/firehose">Firehose</a> -
Firehose is both a Rack application and JavaScript library that makes
building real-time web applications possible.</li>
<li><a
href="https://github.com/joshbuddy/rack-capabilities">rack-capabilities</a>
- Discover just what rack can do (rather, what middleware you have
installed)</li>
<li><a href="https://github.com/eric1234/rack-legacy">rack-legacy</a> -
Run legacy environments like CGI and PHP under any rack server.<br />
</li>
<li><a
href="https://github.com/achiu/rack-recaptcha">Rack::Recaptcha</a> -
Drop this Rack middleware in your web application to enable CAPTCHA
verification via Recaptcha API.</li>
<li><a href="https://github.com/benburkert/rack-tunnel">Rack::Tunnel</a>
- Automatic port forwading via SSH tunneling</li>
<li><a href="https://github.com/benburkert/rack-mux">Rack::Mux</a> -
Multiplex multiple rack servers to the same app.</li>
<li><a
href="https://github.com/bebanjo/rack-useragent">Rack::UserAgent::Filter</a>
- Rack Middleware for filtering by user agent</li>
<li><a
href="https://github.com/sickill/rack-revision-info">Rack::RevisionInfo</a>
- Rack middleware showing current git (or svn) revision number of
deployed application</li>
<li><a href="https://github.com/mirakui/rack-health">Rack::Health</a> -
A health check interface for rack applications.</li>
<li><a href="https://github.com/mirakui/rack-store">Rack::Store</a> - A
Rack middleware what makes the env accessible anywhere while a
request<br />
</li>
<li><a
href="https://github.com/techiferous/rack-plastic">Rack::Plastic</a> -
Helps you changing the HTML using Nokogiri</li>
<li><a href="https://github.com/pboling/rack-toolbar">Rack::ToolBar</a>
- Allows you to create simple Rack Middleware that will insert HTML (or
whatever!) into responses at specific points</li>
<li><a href="https://github.com/techiferous/rack-gsub">Rack::Gsub</a> -
A Rack middleware wrapper for gsub<br />
</li>
<li><a
href="https://github.com/wbzyl/rack-codehighlighter">Rack::Codehighlighter</a>
- A middleware which allows for easy connecting a code highlighter of
somebodys choice to an HTML page containing pieces of programming
code.</li>
<li><a href="https://github.com/yb66/rack-jquery">Rack::JQuery</a> -
jQuery CDN script tags and fallback in one neat package.</li>
<li><a href="https://github.com/yb66/rack-jquery_ui">Rack::JQueryUI</a>
- jQuery-UI CDN script tags and fallback in one neat package.</li>
<li><a
href="https://github.com/yb66/rack-jquery_ui-themes">Rack::JQueryUI::Themes</a>
- jQuery-UI themes CDN script tags and fallback in one neat
package.</li>
<li><a href="https://github.com/yb66/rack-backbone">Rack::Backbone</a> -
Backbone.js CDN script tags and fallback in one neat package.</li>
<li><a href="https://github.com/yb66/rack-polymer">Rack::Polymer</a> -
Polymer CDN script tags and fallback in one neat package. Polymer
leverages web components, a new set of standards designed to provide
reusable components for the web</li>
<li><a href="https://github.com/intridea/rack-stream">Rack::Stream</a> -
A middleware for building multi-protocol streaming rack endpoints. Its
also a simple Stream DSL.</li>
<li><a
href="https://github.com/darbyfrey/rack-streaming-proxy">Rack::StreamingProxy</a>
- A transparent streaming proxy to be used as rack middleware. Streaming
proxy for Rack, the rainbows to Rack::Proxys unicorn</li>
<li><a href="https://github.com/macournoyer/pusher">Pusher</a> - A Rack
middleware that implement Ajax Push aka Comet</li>
<li><a href="https://github.com/pjkelly/robocop">Robocop</a> - a simple
Rack middleware that inserts the X-Robots-Tag into the headers of all
your responses</li>
<li><a href="https://github.com/ckraybill/rack-geoip">Rack::Geoip</a> -
A rack middleware component that handles simple geoip lookups.</li>
<li><a
href="https://github.com/tma/rack-geoipcountry">Rack::GeoIPCountry</a> -
uses the geoip gem and the GeoIP database to lookup the country of a
request by its IP address</li>
<li><a
href="https://github.com/tylerhunt/rack-canonical-host">Rack::CanonicalHost</a>
- https://github.com/tylerhunt/rack-canonical-host<br />
</li>
<li><a href="https://github.com/interagent/committee">committee</a> - A
collection of Rack middleware to support JSON Schema.</li>
<li><a
href="https://github.com/rkh/rack-async-stream">rack-async-stream</a> -
A asynchronous stream middleware based on EventMachine.</li>
</ul>
<h2 id="helpers-and-tools">Helpers and Tools</h2>
<ul>
<li><p>From <a href="https://github.com/rack/rack">Rack built-in
middlewares</a>:</p>
<ul>
<li><p><code>Rack::Request</code> - which also provides query string
parsing and multipart handling.</p></li>
<li><p><code>Rack::Response</code> - for convenient generation of HTTP
replies and cookie handling.<br />
</p></li>
<li><p><code>Rack::MockRequest</code> and
<code>Rack::MockResponse</code>- for efficient and quick testing of Rack
application without real HTTP round-trips.</p></li>
<li><p><code>Rack::Builder</code> - implements a small DSL to
iteratively construct Rack applications.</p></li>
<li><p><code>Rack::Lint</code> - validates your application and the
requests and responses according to the Rack spec.</p></li>
<li><p><code>Rack::File</code> - for serving static files.<br />
</p></li>
<li><p><code>Rack::Directory</code> - serves entries below the root
given, according to the path info of the Rack request. If a directory is
found, the files contents will be presented in an html based index. If
a file is found, the env will be passed to the specified app.</p></li>
<li><p><code>Rack::Cascade</code> - tries a request on several apps, and
returns the first response that is not 404 or 405 (or in a list of
configurable status codes).</p></li>
<li><p><code>Rack::Utils</code> - contains a grab-bag of useful methods
for writing web applications adopted from all kinds of Ruby
libraries.</p></li>
<li><p><code>rackup</code> - a useful tool for running Rack
applications, which uses the <code>Rack::Builder</code> DSL to configure
middleware and build up applications easily.</p>
<p>rackup automatically figures out the environment it is run in, and
runs your application as FastCGI, CGI, or WEBrick—all from the same
configuration.</p>
<ul>
<li><a
href="https://github.com/rack/rack/wiki/%28tutorial%29-rackup-howto">Rackup
howto</a></li>
</ul></li>
</ul></li>
<li><p><a href="https://github.com/brynary/rack-test">rack-test</a> - A
layer on top of Racks <code>MockRequest</code> similar to Merbs
<code>RequestHelper</code>. (~ 200 LOC)</p></li>
<li><p><a
href="https://github.com/guilleiguaran/rack-test-rest">rack-test-test</a>
- an extension to rack-test that when combined with Test::Unit
simplifies the process of unit testing properly designed RESTful
APIs</p></li>
<li><p><a
href="https://github.com/lookout/lookout-rack-test">Lookout::Rack::Test</a>
- RSpec and Cucumber test helpers.</p></li>
<li><p><a
href="https://github.com/test-unit/test-unit-capybara/">test-unit-capybara</a>
- integration testing helper library for Rack applications, a Capybara
adapter for <a
href="https://github.com/test-unit/test-unit">test-unit</a></p></li>
<li><p><a href="RackToolkit">rack_toolkit</a> - A dynamic Rack server
and helper methods to help testing Rack apps.</p></li>
<li><p><a href="https://github.com/splitrb/split">Split</a> - Rack based
ab testing framework designed to work with Rails, Sinatra or any other
rack based app. Split is heavily inspired by the Abingo and Vanity rails
ab testing plugins and Resque in its use of Redis</p></li>
<li><p><a
href="https://github.com/mattt/rack-scaffold">Rack::Scaffold</a> -
Automatically generate RESTful CRUD services<br />
</p></li>
<li><p><a
href="https://github.com/rkh/almost-rack/blob/meister/almost-rackup">almost-rack</a>
- Rack in three lines of code.</p></li>
<li><p><a href="https://github.com/rkh/rack-graph">rack-graph</a> -
Generate a tree displaying all your Rack middleware.</p></li>
<li><p><a href="https://github.com/influitive/apartment">Apartment</a> -
Database multi-tenancy for Rack (and Rails) applications.</p></li>
</ul>
<h2 id="miscellaneous">Miscellaneous</h2>
<blockquote>
<p>HTTP Clients</p>
</blockquote>
<ul>
<li><a href="https://github.com/lostisland/faraday">Faraday</a> -
Faraday is an HTTP client lib that provides a common interface over many
adapters (such as Net::HTTP) and embraces the concept of Rack middleware
when processing the request/response cycle.</li>
<li><a href="https://github.com/halorgium/rack-client">rack-client</a> -
A HTTP client that aims to be a good Rack citizen.<br />
</li>
<li><a href="https://github.com/fnando/rack-api">rack-api</a> - Create
web app APIs that respond to one or more formats using an elegant
DSL</li>
<li><a href="https://github.com/mwunsch/weary">weary</a> - A framework
and DSL for building RESTful web service clients. Full Rack
integration</li>
<li><a href="https://github.com/godfat/rest-core">rest-core</a> -
Modular Ruby clients interface for REST APIs. rest-core consists of
composable middleware that allows you to build a REST client for any
REST API. Or in the case of common APIs such as Facebook, Github, and
Twitter, you can simply use the dedicated clients provided by <a
href="https://github.com/godfat/rest-more">rest-more</a>. See the slide
<a href="http://godfat.org/slide/2015-01-13-rest-core-promise/">The
Promise of rest-core</a> for more info.</li>
</ul>
<blockquote>
<p>Vagrant Middlewares</p>
</blockquote>
<ul>
<li><p><a href="https://www.youtube.com/watch?v=i6pyhq3ZvyI">Videos:
Rack Middleware as a General Purpose Abstraction by Mitchell
Hashimoto</a></p>
<ul>
<li>the slide is available on <a
href="https://speakerdeck.com/mitchellh/middleware-a-general-purpose-abstraction">speakdeck</a>.</li>
<li><a href="https://github.com/mitchellh/middleware">Generalized
middleware implementation for Ruby by Mitchell Hashimoto</a> - ~ 130
LOC</li>
</ul></li>
<li><p><a
href="https://github.com/mitchellh/vagrant/blob/master/lib%2Fvagrant%2Faction.rb">Vagrant
Middlewares</a> - Vagrant calls middlewares “actions” and a stack of
middlewares an “action sequence.” (But you may also just call them
middleware and middleware stacks, theyre mostly called the other names
for histortical purposes)</p>
<ul>
<li><code>Vagrant::Action::Warden</code> - The action warden is a
middleware which injects itself between every other middleware, watching
for exceptions which are raised and performing proper cleanup on every
action by calling the recover method. The warden therefore allows
middlewares to not worry about exceptional events, and by providing a
simple callback, can clean up in any erroneous case</li>
<li><code>Vagrant::Action::Builtin::BoxAdd</code> - This middleware will
download a remote box and add it to the given box collection.</li>
<li><code>Vagrant::Action::Builtin::BoxCheckOutdated</code> - This
middleware checks if there are outdated boxes. By default, it only
checks locally, but if box_outdated_refresh is set, it will refresh the
metadata associated with a box.</li>
<li><code>Vagrant::Action::Builtin::BoxRemove</code> - This middleware
will remove a box for a given provider.<br />
</li>
<li><code>Vagrant::Action::Builtin::BoxUpdate</code> - This middleware
updates a specific box if there are updates available.</li>
<li><code>Vagrant::Action::Builtin::Call</code> - This middleware class
allows a sort of “conditional” run within a single middlware sequence.
It takes another middleware runnable, runs it with the same environment,
then yields the resulting env to a block, allowing that block to
determine the next course of action in the middleware sequence.</li>
<li><code>Vagrant::Action::Builtin::ConfigValidate</code> - This class
validates the configuration and raises an exception if there are any
validation errors.</li>
<li><code>Vagrant::Action::Builtin::Confirm</code> - This class asks the
user to confirm some sort of question with a “Y/N” question. The only
parameter is the text to ask the user. The result is placed in
<code>env[:result]</code> so that it can be used with the
<code>Call</code> class.</li>
<li><code>Vagrant::Action::Builtin::DestroyConfirm</code> - This class
asks the user to confirm the destruction of a machine that Vagrant
manages.</li>
<li><code>Vagrant::Action::Builtin::EnvSet</code> - This middleware
class allows you to modify the environment hash in the middle of a
middleware sequence. The new environmental data will take affect at this
stage in the middleware and will persist through.</li>
<li><code>Vagrant::Action::Builtin::GracefulHalt</code> - This
middleware class will attempt to perform a graceful shutdown of the
machine using the guest implementation<br />
</li>
<li><code>Vagrant::Action::Builtin::HandleBox</code> - This built-in
middleware handles the box setting by verifying the box is already
installed, dowloading the box if it isnt, updating the box if it is
requested, etc</li>
<li><code>Vagrant::Action::Builtin::HandleBoxUrl</code></li>
<li><code>Vagrant::Action::Builtin::HandleForwardedPortCollisions</code>
- This middleware class will detect and handle collisions with forwarded
ports, whether that means raising an error or repairing them
automatically.</li>
<li><code>Vagrant::Action::Builtin::IsState</code> - This middleware is
meant to be used with Call and can check if a machine is in the given
state ID.</li>
<li><code>Vagrant::Action::Builtin::Lock</code> - This class creates a
multi-process lock using flock. The lock is active for the remainder of
the middleware stack.</li>
<li><code>Vagrant::Action::Builtin::Message</code> - This middleware
simply outputs a message to the UI.</li>
<li><code>Vagrant::Action::Builtin::Provision</code> - This class will
run the configured provisioners against the machine.</li>
<li><code>Vagrant::Action::Builtin::ProvisionerCleanup</code> - This
action will run the cleanup methods on provisioners and should be used
as part of any Destroy action.</li>
<li><code>Vagrant::Action::Builtin::SSHExec</code> - This class will
exec into a full fledged SSH console into the remote machine. This
middleware assumes that the VM is running and ready for SSH, and uses
the <code>Machine#ssh_info</code> method to retrieve SSH information
necessary to connect.</li>
<li><code>Vagrant::Action::Builtin::SSHRun</code> - This class will run
a single command on the remote machine and will mirror the output to the
UI. The resulting exit status of the command will exist in the
<code>:ssh_run_exit_status</code> key in the environment.</li>
<li><code>Vagrant::Action::Builtin::SetHostname</code> - This middleware
sets the hostname of the guest according to the “vm.hostname”
configuration parameter if it is set</li>
<li><code>Vagrant::Action::Builtin::SyncedFolderCleanup</code> - This
middleware will run cleanup tasks for synced folders using the
appropriate synced folder plugin</li>
<li><code>Vagrant::Action::Builtin::SyncedFolders</code> - This
middleware will setup the synced folders for the machine using the
appropriate synced folder plugin.</li>
<li><code>Vagrant::Action::Builtin::WaitForCommunicator</code> - This
waits for the communicator to be ready for a set amount of time.</li>
</ul></li>
</ul>
<blockquote>
<p>Vagrant Middleware Stack Builder and Runner</p>
</blockquote>
<ul>
<li><code>Vagrant::Action::Builder</code> - Action builder which
provides a nice DSL for building up a middleware sequence for Vagrant
actions. This code is based heavily off of Rack::Builder and
ActionDispatch::MiddlewareStack in Rack and Rails, respectively.</li>
<li><code>Vagrant::Action::Runner</code> - This runner does the default
expected behavior of running the middleware stacks in order, then
reversing the order.</li>
<li><code>Vagrant::Action::Hook</code> - This class manages hooks into
existing Builder stacks, and lets you add and remove middleware classes.
This is the primary method by which plugins can hook into built-in
middleware stacks.</li>
</ul>
<h2 id="inspiration">Inspiration</h2>
<ul>
<li><p><a href="http://wsgi.readthedocs.org/">WSGI (Python)</a> - The
Web Server Gateway Interface (WSGI) is a specification for simple and
universal interface between web servers and web applications or
frameworks for the Python. WSGI is a Python standard described in detail
in <a href="http://www.python.org/dev/peps/pep-3333">PEP
3333</a></p></li>
<li><p><a href="http://rack.github.io/">Rack (Ruby)</a> - Rack provides
a modular and adaptable interface for developing web applications in
Ruby. By wrapping HTTP requests and responses it unifies the API for web
servers, web frameworks, and software in between (the so-called
middleware) into a single method call.</p></li>
<li><p><a href="https://github.com/elixir-lang/plug">Plug (Elixir)</a> -
Plug is A specification for composable modules between web applications,
and its also connection adapters for different web servers in the
Erlang VM. Plug is sinatra-like, and Elixir has a Rails-like framework
called <a href="http://www.phoenixframework.org/">Phoenix</a></p></li>
<li><p><a href="https://github.com/fukamachi/clack/">Clack (Lisp)</a> -
Clack is a web application environment for Common Lisp inspired by
Pythons WSGI and Rubys Rack.</p></li>
<li><p><a href="https://github.com/nfjinjing/hack2">Hack (Haskell)</a> -
Hack2 is a port of Rubys Rack webserver interface.</p></li>
<li><p><a href="http://wiki.commonjs.org/wiki/JSGI">JSGI
(JavaScript)</a> - JavaScript Gateway Interface, is an interface between
web servers and JavaScript-based web applications and frameworks. It was
inspired by the Rack for Ruby and WSGI for Python and was one of the
inspirations of PSGI for Perl.</p></li>
<li><p><a href="https://metacpan.org/pod/PSGI">PSGI (Perl)</a> - Perl
Web Server Gateway Interface is an interface between Web servers and
Perl-based Web applications and frameworks that allows writing portable
applications that can be run as standalone servers or using CGI,
FastCGI, mod_perl, et al. It is inspired by the Web Server Gateway
Interface for Python, Rack for Ruby and JSGI for JavaScript.</p></li>
<li><p><a href="http://keplerproject.github.io/wsapi/">WSAPI (Lua)</a> -
WSAPI is an API that abstracts the web server from Lua web applications.
By coding against WSAPI your application can run on any of the supported
servers and interfaces (currently CGI, FastCGI and Xavante, on Windows
and UNIX-based systems). WSAPIs main influence is Rubys Rack
framework, but it was also influenced by Pythons WSGI
(<code>PEP 333</code>). Its not a direct clone of either of them,
though, and tries to follow standard Lua idioms.</p></li>
<li><p><a href="http://stackphp.com/">StackPHP (PHP)</a> - a PHP
interface for framework-agnostic code sharing</p></li>
<li><p><a href="http://owin.org/">OWIN (.NET)</a> - Open Web Interface
for .NET, defines a standard interface between .NET web servers and web
applications. The goal of the OWIN interface is to decouple server and
application, encourage the development of simple modules for .NET web
development, and, by being an open standard, stimulate the open source
ecosystem of .NET web development tools. <a
href="https://katanaproject.codeplex.com/">Katana</a> is the
implementation of OWIN components.</p></li>
</ul>
<h2 id="license">License</h2>
<p><a href="https://creativecommons.org/publicdomain/zero/1.0/"><img
src="http://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg"
alt="CC0" /></a></p>
<p>To the extent possible under law, <a
href="http://coopermaa2nd.blogspot.tw/">coopermaa</a> has waived all
copyright and related or neighboring rights to this work.</p>