Class: Thin::Request::Protocol75

Inherits:
WebSocketHandler show all
Defined in:
lib/thin_extensions.rb

Instance Method Summary collapse

Methods inherited from WebSocketHandler

#initialize

Constructor Details

This class inherits a constructor from Thin::Request::WebSocketHandler

Instance Method Details

#handshakeObject



90
91
92
93
94
95
96
97
# File 'lib/thin_extensions.rb', line 90

def handshake
  upgrade =  "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
  upgrade << "Upgrade: WebSocket\r\n"
  upgrade << "Connection: Upgrade\r\n"
  upgrade << "WebSocket-Origin: #{@request.env['HTTP_ORIGIN']}\r\n"
  upgrade << "WebSocket-Location: #{@request.websocket_url}\r\n\r\n"
  upgrade
end