Class: WebSocketRb::Protocol::Handshake

Inherits:
Object
  • Object
show all
Defined in:
lib/web_socket_rb/protocol/handshake.rb

Constant Summary collapse

MAGIC_KEY =
'258EAFA5-E914-47DA-95CA-C5AB0DC85B11'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ Handshake

Returns a new instance of Handshake.



10
11
12
# File 'lib/web_socket_rb/protocol/handshake.rb', line 10

def initialize(conn)
  @conn = conn
end

Instance Method Details

#runObject

Generate a proper handshake response based on request



15
16
17
18
19
# File 'lib/web_socket_rb/protocol/handshake.rb', line 15

def run
  validate_request
  generate_proper_response
  @conn
end