Sha256: dd0ccb72a6db53981a062245dc3a357de9d700576c87f1b8495a1a16f2a4a861

Contents?: true

Size: 844 Bytes

Versions: 11

Compression:

Stored size: 844 Bytes

Contents

# This file file monkeypatches Thin to return a proper SWF policy file.
#
# You should only use this in development. It has not been well tested in a
# production environment.
#
# NOTE: This only works if you are using Thin with EventMachine.
#
# Some helpful links:
# http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html
# http://blog.vokle.com/index.php/2009/06/10/dealing-with-adobe-and-serving-socket-policy-servers-via-nginx-and-10-lines-of-code/

require 'thin'
# Ensure the class already exists so we are overwriting it.
Thin::Connection

class Thin::Connection
  include Firehose::SwfPolicyRequest
  alias_method :receive_data_without_swf_policy, :receive_data
  def receive_data(data)
    if handle_swf_policy_request(data)
      return false
    else
      receive_data_without_swf_policy(data)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
firehose-1.1.1 lib/thin_em_swf_policy.rb
firehose-1.1.0 lib/thin_em_swf_policy.rb
firehose-1.0.0 lib/thin_em_swf_policy.rb
firehose-0.2.alpha.10 lib/thin_em_swf_policy.rb
firehose-0.2.alpha.9 lib/thin_em_swf_policy.rb
firehose-0.2.alpha.8 lib/thin_em_swf_policy.rb
firehose-0.2.alpha.7 lib/thin_em_swf_policy.rb
firehose-0.2.alpha.6 lib/thin_em_swf_policy.rb
firehose-0.2.alpha.5 lib/thin_em_swf_policy.rb
firehose-0.2.alpha.3 lib/thin_em_swf_policy.rb
firehose-0.2.alpha.2 lib/thin_em_swf_policy.rb