def accept
      @socket   = server.accept
      @messages = {}

      @driver = ::WebSocket::Driver.server(self)
      @driver.on(:connect) { |_event| @driver.start }
      @driver.on(:message) do |event|
        command_id = JSON.parse(event.data)['command_id']
        @messages[command_id] = event.data
      end
    end
def accept
      @socket   = server.accept
      @messages = {}

      @driver = ::WebSocket::Driver.server(self)
      @driver.on(:connect) { |_event| @driver.start }
      @driver.on(:message) do |event|
        command_id = JSON.parse(event.data)['command_id']
        @messages[command_id] = event.data
      end
    end
Accept a client on the TCP server socket, then receive its initial HTTP request
 and use that to initialize a Web Socket.