Class: Porous::Server::Connect

Inherits:
Object
  • Object
show all
Defined in:
lib/porous/server/connect.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object

Only used for WebSocket or SSE upgrades.



7
8
9
10
11
12
13
14
15
# File 'lib/porous/server/connect.rb', line 7

def call(env)
  if env['rack.upgrade?'].nil?
    [404, {}, []]
  else
    $socket ||= Socket.new
    env['rack.upgrade'] = $socket
    [200, {}, []]
  end
end