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