public static void main (String args[]) throws Exception
  {
    String hostname = HOSTNAME;
    int port = PORT;
    int timeToSleep = TIME_TO_SLEEP;
    
    if(args.length > 0) {
      List<String> argList = Arrays.asList(args);
      if(argList.contains("-h")) {
        int indexOf = argList.indexOf("-h");
        hostname = argList.get(indexOf + 1);
      }
      if(argList.contains("-t")) {
        int indexOf = argList.indexOf("-t");
        timeToSleep = Integer.valueOf( argList.get(indexOf + 1) ) * 1000;
      }
      if(argList.contains("-p")) {
        int indexOf = argList.indexOf("-p");
        port = Integer.valueOf( argList.get(indexOf + 1) );
      }
    }

    InetSocketAddress socketAddress = new InetSocketAddress(hostname, port);
    HttpServer server = HttpServer.create(socketAddress, 0);
    server.createContext("/", new RequestHandler(new MiniGameRequestReceiverFactory()));
    server.setExecutor(Executors.newCachedThreadPool());
    server.start();
    try
    {
      Thread.sleep(timeToSleep);
    }
    catch (InterruptedException e)
    {
    }
    server.stop(10);
  }