Created
August 21, 2014 10:10
-
-
Save masone/5955f4cc0b4d4ef372db to your computer and use it in GitHub Desktop.
Thin with SSL as default server for use with rails server. Works with Rubymine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rack' | |
# Thin SSL workaround | |
module Rack | |
module Handler | |
class Thin | |
def self.run(app, options={}) | |
app = Rack::Chunked.new(Rack::ContentLength.new(app)) | |
server = ::Thin::Server.new(options[:Host] || '0.0.0.0', | |
options[:Port] || 3000, | |
app) | |
server.ssl = true | |
server.ssl_options = { | |
:private_key_file => SERVER_KEY, | |
:cert_chain_file => SERVER_PEM | |
} | |
yield server if block_given? | |
server.start | |
end | |
end | |
end | |
end | |
# Workaround end | |
APP_PATH = File.expand_path('../../config/application', __FILE__) | |
require_relative '../config/boot' | |
require 'rails/commands' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Its working with RubyMine 6.3.3. Thank you.
Also you can pass private_key_file and cert_chain_file as nil