#!/usr/bin/env ruby # Modified Thin command line interface script. # This is fallback for WebSocket-Rack. # Use it when you have EventMachine version < 1.0.0 # Rationale: # Older versions of EM have bug that prevent to # clearing connection inactivity once it's set. # This one will set connection timeout to 0 at # default, so there will be no need to overwrite it. # Be aware that this will also change inactivity # timeout for "normal" connection, so it will be # easy to make DoS attack. require 'rubygems' require 'thin' if EM::VERSION < "1.0.0" begin old_verbose, $VERBOSE = $VERBOSE, nil ::Thin::Server.const_set 'DEFAULT_TIMEOUT', 0 ensure $VERBOSE = old_verbose end end Thin::Runner.new(ARGV).run!