lib/faye/adapters/rack_adapter.rb in faye-0.6.5 vs lib/faye/adapters/rack_adapter.rb in faye-0.6.6
- old
+ new
@@ -41,12 +41,21 @@
def get_client
@client ||= Client.new(@server)
end
- def listen(port)
+ def listen(port, ssl_options = nil)
handler = Rack::Handler.get('thin')
- handler.run(self, :Port => port) { |s| @thin_server = s }
+ handler.run(self, :Port => port) do |s|
+ if ssl_options
+ s.ssl = true
+ s.ssl_options = {
+ :private_key_file => ssl_options[:key],
+ :cert_chain_file => ssl_options[:cert]
+ }
+ end
+ @thin_server = s
+ end
end
def stop
return unless @thin_server
@thin_server.stop