class WebSocket::Driver::Server

def parse(chunk)

def parse(chunk)
  return @delegate.parse(chunk) if @delegate
  @http.parse(chunk)
  return fail_request('Invalid HTTP request') if @http.error?
  return unless @http.complete?
  @delegate = Driver.rack(self, @options)
  open
  EVENTS.each do |event|
    @delegate.on(event) { |e| emit(event, e) }
  end
  emit(:connect, ConnectEvent.new)
end