class WebSocket::Handshake::Handler::Client

Private Instance Methods

handshake_keys() click to toggle source

@see WebSocket::Handshake::Handler::Base#header_handshake_keys

# File lib/websocket/handshake/handler/client.rb, line 17
def handshake_keys
  super + @handshake.headers.to_a
end
header_line() click to toggle source

@see WebSocket::Handshake::Handler::Base#header_line

# File lib/websocket/handshake/handler/client.rb, line 10
def header_line
  path = @handshake.path
  path += '?' + @handshake.query if @handshake.query
  "GET #{path} HTTP/1.1"
end
verify_protocol() click to toggle source

Verify if received header matches with one of the sent ones @return [Boolean] True if matching. False otherwise(appropriate error is set)

# File lib/websocket/handshake/handler/client.rb, line 23
def verify_protocol
  return true if supported_protocols.empty?
  protos = provided_protocols & supported_protocols
  raise WebSocket::Error::Handshake::UnsupportedProtocol if protos.empty?
  true
end