This class and it's descendants are included in client or server handshake in order to extend basic functionality
# File lib/websocket/handshake/handler/base.rb, line 7 def initialize(handshake) @handshake = handshake end
@see WebSocket::Handshake::Base#to_s
# File lib/websocket/handshake/handler/base.rb, line 12 def to_s result = [ header_line ] handshake_keys.each do |key| result << key.join(': ') end result << "" result << finishing_line result.join("\r\n") end
# File lib/websocket/handshake/handler/base.rb, line 22 def valid? true end
Set data to send after headers. In most cases it will be blank data. @return [String] data
# File lib/websocket/handshake/handler/base.rb, line 42 def finishing_line "" end
Set handshake headers. Provided as array because some protocol version require specific order of fields. @return [Array] List of headers as arrays [ key, value ]
# File lib/websocket/handshake/handler/base.rb, line 36 def handshake_keys [] end
Set first line of text representation according to specification. @return [String] First line of HTTP header
# File lib/websocket/handshake/handler/base.rb, line 30 def header_line "" end