Class WebSocket::Handshake::Base
In: lib/websocket/handshake/base.rb
Parent: Object

@abstract Subclass and override to implement custom handshakes

Methods

<<   finished?   inspect   leftovers   new   should_respond?   to_s   uri   valid?  

Constants

HEADER = /^([^:]+):\s*(.+)$/

Attributes

error  [R] 
host  [R] 
path  [R] 
port  [R] 
query  [R] 
secure  [R] 
state  [R] 
version  [R] 

Public Class methods

Initialize new WebSocket Handshake and set it‘s state to :new

Public Instance methods

@abstract Add data to handshake

Is parsing of data finished? @return [Boolena] True if request was completely parsed or error occured. False otherwise

Recreate inspect as to_s was overwritten

Data left from parsing. Sometimes data that doesn‘t belong to handshake are added - use this method to retrieve them. @return [String] String if some data are available. Nil otherwise

@abstract Should send data after parsing is finished?

Return textual representation of handshake request or response @return [String] text of response

URI of request. @return [String] Full URI with protocol @example

  @handshake.uri #=> "ws://example.com/path?query=true"

Is parsed data valid? @return [Boolean] False if some errors occured. Reason for error could be found in error method

[Validate]