Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an alternative back-end for Unicorn #5

Merged
merged 9 commits into from
Jan 24, 2013
Merged

Conversation

joeyAghion
Copy link
Contributor

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. A complete example:

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!

@dblock
Copy link
Owner

dblock commented Jan 24, 2013

Ruby 1.8.7 build failed.

@joeyAghion
Copy link
Contributor Author

The just-added commit fixes support for ruby 1.8.7 and adds a stub unicorn.rb config file.

@dblock dblock merged commit 6275e45 into dblock:master Jan 24, 2013
@dblock
Copy link
Owner

dblock commented Jan 24, 2013

Merged, thank you!

@fancyremarker
Copy link

This is really nice, guys. Adds enormous value and robustness to the Heroku platform. I think you need to write it up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants