Sha256: e55770612c611e7b8cc3cd7afd32fcff0378d91735c81d520c2c94d6efbbf04c

Contents?: true

Size: 972 Bytes

Versions: 14

Compression:

Stored size: 972 Bytes

Contents

require 'rubygems'
require 'rack/content_length'
require 'rack/chunked'

port   = ARGV[0] || 7000
secure = ARGV[1] == 'ssl'
engine = ARGV[2] || 'thin'
spec   = File.expand_path('../../spec', __FILE__)

require File.expand_path('../app', __FILE__)
Faye::WebSocket.load_adapter(engine)

case engine

when 'goliath'
  class WebSocketServer < Goliath::API
    def response(env)
      App.call(env)
    end
  end

when 'rainbows'
  rackup = Unicorn::Configurator::RACKUP
  rackup[:port] = port
  rackup[:set_listener] = true
  options = rackup[:options]
  options[:config_file] = spec + '/rainbows.conf'
  Rainbows::HttpServer.new(App, options).start.join

when 'thin'
  EM.run {
    thin = Rack::Handler.get('thin')
    thin.run(App, :Port => port) do |server|
      if secure
        server.ssl_options = {
          :private_key_file => spec + '/server.key',
          :cert_chain_file  => spec + '/server.crt'
        }
        server.ssl = true
      end
    end
  }
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
faye-websocket-0.4.7-java examples/server.rb
faye-websocket-0.4.7 examples/server.rb
faye-websocket-0.4.6-java examples/server.rb
faye-websocket-0.4.6 examples/server.rb
faye-websocket-0.4.5-java examples/server.rb
faye-websocket-0.4.5 examples/server.rb
_bushido-faye-websocket-0.4.4 examples/server.rb
faye-websocket-0.4.4-java examples/server.rb
faye-websocket-0.4.4 examples/server.rb
faye-websocket-0.4.3 examples/server.rb
faye-websocket-0.4.2 examples/server.rb
faye-websocket-0.4.1 examples/server.rb
faye-websocket-0.4.0 examples/server.rb
faye-websocket-0.3.0 examples/server.rb