Sha256: 1e83c75fabb3762927e04b6ee1aefb169fb75131020024aeff53eaafc6804aba

Contents?: true

Size: 654 Bytes

Versions: 13

Compression:

Stored size: 654 Bytes

Contents

module EventMachine
  module WebSocket
    class Handler75 < Handler
      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

13 entries across 13 versions & 2 rubygems

Version Path
keyhole-0.1.7 lib/em-websocket/handler75.rb
keyhole-0.1.6 lib/em-websocket/handler75.rb
keyhole-0.1.5 lib/em-websocket/handler75.rb
keyhole-0.1.4 lib/em-websocket/handler75.rb
keyhole-0.1.3 lib/em-websocket/handler75.rb
keyhole-0.1.2 lib/em-websocket/handler75.rb
keyhole-0.1.1 lib/em-websocket/handler75.rb
keyhole-0.1.0 lib/em-websocket/handler75.rb
keyhole-0.0.0 lib/em-websocket/handler75.rb
em-websocket-0.1.4 lib/em-websocket/handler75.rb
em-websocket-0.1.3 lib/em-websocket/handler75.rb
em-websocket-0.1.2 lib/em-websocket/handler75.rb
em-websocket-0.1.1 lib/em-websocket/handler75.rb