lib/em-websocket/handler75.rb in em-websocket-0.1.4 vs lib/em-websocket/handler75.rb in em-websocket-0.2.0
- old
+ new
@@ -1,21 +1,8 @@
module EventMachine
module WebSocket
class Handler75 < Handler
- def handshake
- location = "#{@request['Host'].scheme}://#{@request['Host'].host}"
- location << ":#{@request['Host'].port}" if @request['Host'].port
- location << @request['Path']
-
- 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['Origin']}\r\n"
- upgrade << "WebSocket-Location: #{location}\r\n\r\n"
-
- debug [:upgrade_headers, upgrade]
-
- return upgrade
- end
+ include Handshake75
+ include Framing76
end
end
end