Sha256: d4d9ecf383a9ef36140bfde369993eb6f150d760f299c8d75d73f292848d679c

Contents?: true

Size: 915 Bytes

Versions: 13

Compression:

Stored size: 915 Bytes

Contents

require 'celluloid/websocket/client/connection'
# DIRTY HACK TO make websocket-driver to not use Capistrano::DSL env
Celluloid::WebSocket::Client::Connection.class_eval do
  def env
    env_hash = ENV.each_with_object({}) do |(key, value), memo|
      memo['HTTP_' + key.upcase.tr('-', '_')] = value
      memo
    end
    env_hash.reverse_merge!('REQUEST_METHOD'                => 'GET',
                            'HTTP_CONNECTION'               => 'Upgrade',
                            'HTTP_UPGRADE'                  => 'websocket',
                            'HTTP_ORIGIN'                  => @url,
                            'HTTP_SEC_WEBSOCKET_KEY'        => SecureRandom.uuid,
                            'HTTP_SEC_WEBSOCKET_PROTOCAL'    => 'ws',
                            'HTTP_SEC_WEBSOCKET_VERSION'    => '13'
                            )
    ::Rack::MockRequest.env_for(@url, env_hash)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
capistrano_multiconfig_parallel-0.29.2 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.29.1 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.29.0 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.28.5 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.28.4 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.28.3 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.28.2 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.28.1 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.28.0 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.27.2 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.27.0 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.26.0 lib/capistrano_multiconfig_parallel/initializers/websocket.rb
capistrano_multiconfig_parallel-0.25.1 lib/capistrano_multiconfig_parallel/initializers/websocket.rb