lib/firehose/rack/consumer/web_socket.rb
# Setup a handler for the websocket connection.
Setup a handler for the websocket connection.
Setup a handler for the websocket connection .
def call(env)
          begin
            ws = Faye::WebSocket.new(env)
            if Consumer.multiplexing_request?(env)
              MultiplexingHandler.new(ws)
            else
              DefaultHandler.new(ws)
            end
            ws.rack_response
          rescue StandardError => e
            Firehose.logger.error "WS connection error: #{e.inspect}"
            Firehose::Server.metrics.error!(:ws_invalid_request)
            response(400, "Invalid WebSocket request")
          end
        end
def call ( env ) begin ws = Faye :: WebSocket . new ( env ) if Consumer . multiplexing_request? ( env ) MultiplexingHandler . new ( ws ) else DefaultHandler . new ( ws ) end ws . rack_response rescue StandardError => e Firehose . logger . error "WS connection error: #{e.inspect}" Firehose :: Server . metrics . error! ( :ws_invalid_request ) response ( 400 , "Invalid WebSocket request" ) end end
Setup a handler for the websocket connection.
Setup a handler for the websocket connection .
env
<not_specific>