Skip to content
Browse files

Farewell Protocol75

  • Loading branch information...
1 parent f28ba2c commit fc3f6555f5eadd9525f0428339e532b8320f185e @lifo committed
Showing with 2 additions and 21 deletions.
  1. +0 −11 lib/cramp/websocket/extension.rb
  2. +1 −3 lib/cramp/websocket/rainbows.rb
  3. +1 −7 lib/cramp/websocket/thin_backend.rb
View
11 lib/cramp/websocket/extension.rb
@@ -27,17 +27,6 @@ def initialize(env, websocket_url, body)
end
end
- class Protocol75 < WebSocketHandler
- 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: #{@env['HTTP_ORIGIN']}\r\n"
- upgrade << "WebSocket-Location: #{@websocket_url}\r\n\r\n"
- upgrade
- end
- end
-
class Protocol76 < WebSocketHandler
def handshake
key1 = @env['HTTP_SEC_WEBSOCKET_KEY1']
View
4 lib/cramp/websocket/rainbows.rb
@@ -24,9 +24,7 @@ def on_read(data)
@state = :websocket
@input.rewind
- handler = @env['HTTP_SEC_WEBSOCKET_KEY1'] &&
- @env['HTTP_SEC_WEBSOCKET_KEY2'] ? Protocol76 : Protocol75
- write(handler.new(@env, websocket_url, @buf).handshake)
+ write(Protocol76.new(@env, websocket_url, @buf).handshake)
app_call NULL_IO
else
super
View
8 lib/cramp/websocket/thin_backend.rb
@@ -33,13 +33,7 @@ class Thin::Request
include Cramp::WebsocketExtension
def websocket_upgrade_data
- handler = if @env['HTTP_SEC_WEBSOCKET_KEY1'] and @env['HTTP_SEC_WEBSOCKET_KEY2']
- Protocol76
- else
- Protocol75
- end
-
- handler.new(@env, websocket_url, body.read).handshake
+ Protocol76.new(@env, websocket_url, body.read).handshake
end
end

0 comments on commit fc3f655

Please sign in to comment.
Something went wrong with that request. Please try again.