Sha256: c56b509f769ca37714d547cd1f0907619d63eb91aa67a29d8ecea5e69e53bd97
Contents?: true
Size: 914 Bytes
Versions: 51
Compression:
Stored size: 914 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
51 entries across 51 versions & 1 rubygems