# File lib/faye/websocket/hybi_parser/handshake.rb, line 18
        def request_data
          hostname = @uri.host + (@uri.port ? ":#{@uri.port}" : '')
          path = (@uri.path == '') ? '/' : @uri.path
          headers = [
            "GET #{path}#{@uri.query ? '?' : ''}#{@uri.query} HTTP/1.1",
            "Host: #{hostname}",
            "Upgrade: websocket",
            "Connection: Upgrade",
            "Sec-WebSocket-Key: #{@key}",
            "Sec-WebSocket-Version: 13"
          ]

          if @protocols
            headers << "Sec-WebSocket-Protocol: #{@protocols * ', '}"
          end

          (headers + ['','']).join("\r\n")
        end