Sha256: 14929b893169ddd19e369d741ca4ace9ecf069a49d273fce44ec9a2134a5a5ed

Contents?: true

Size: 641 Bytes

Versions: 9

Compression:

Stored size: 641 Bytes

Contents

module EventMachine
  module WebSocket
    module Handshake75
      def handshake
        location  = "#{request['host'].scheme}://#{request['host'].host}"
        location << ":#{request['host'].port}" if request['host'].port
        location << request['path']

        upgrade =  "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
        upgrade << "Upgrade: WebSocket\r\n"
        upgrade << "Connection: Upgrade\r\n"
        upgrade << "WebSocket-Origin: #{request['origin']}\r\n"
        upgrade << "WebSocket-Location: #{location}\r\n\r\n"

        debug [:upgrade_headers, upgrade]

        return upgrade
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
sonixlabs-em-websocket-0.3.8 lib/em-websocket/handshake75.rb
sonixlabs-em-websocket-0.3.7 lib/em-websocket/handshake75.rb
em-websocket-0.3.8 lib/em-websocket/handshake75.rb
em-websocket-0.3.7 lib/em-websocket/handshake75.rb
em-websocket-0.3.6 lib/em-websocket/handshake75.rb
em-websocket-0.3.5 lib/em-websocket/handshake75.rb
em-websocket-0.3.2 lib/em-websocket/handshake75.rb
em-websocket-0.3.1 lib/em-websocket/handshake75.rb
em-websocket-0.3.0 lib/em-websocket/handshake75.rb