dblock/heroku-forward — pull request #5 by joeyAghion (2013-01-24 15:20:53+00:00)
Title: Add an alternative back-end for Unicorn

Based heavily on `Heroku::Forward::Backends::Thin`, I added a `Heroku::Forward::Backends::Unicorn`.

Now that there are multiple back-ends, I thought it best to not automatically require all of the implementations. Instead, the proxy code must now require both `heroku-forward` and the chosen implementation.

The Unicorn back-end doesn't currently support the same SSL options as Thin, and adds a `:config_file` option referring to an optional [Unicorn config file](http://unicorn.bogomips.org/Unicorn/Configurator.html). A complete example:

```ruby
require 'heroku-forward'
require 'heroku/forward/backends/unicorn'

application = File.expand_path('../my_app.ru', __FILE__)
config_file = File.expand_path('../config/unicorn.rb', __FILE__)
backend = Heroku::Forward::Backends::Unicorn.new(application: application, env: env, config_file: config_file)
proxy = Heroku::Forward::Proxy::Server.new(backend, host: '0.0.0.0', port: port, retries: 100)
proxy.logger = Logger.new(STDOUT)
proxy.forward!
```