Sha256: bb0dc7c4099bcec9b8d25db763a9256d20057041eaec2170fed0b2969a151e81

Contents?: true

Size: 641 Bytes

Versions: 2

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

2 entries across 2 versions & 1 rubygems

Version Path
em-websocket-0.2.1 lib/em-websocket/handshake75.rb
em-websocket-0.2.0 lib/em-websocket/handshake75.rb