Exemplo n.º 1
0
  private HttpServer createServer(StartArgs startArgs) {
    if (startArgs.isHttps()) {
      return ActualHttpServer.createHttpsLogServer(
          startArgs.getPort(), startArgs.getHttpsCertificate());
    }

    return ActualHttpServer.createLogServer(startArgs.getPort());
  }
Exemplo n.º 2
0
  private HttpServer createBaseHttpServer(
      Iterable<? extends RunnerSetting> settings, StartArgs startArgs) {
    HttpServer server = createServer(startArgs);

    for (RunnerSetting setting : settings) {
      HttpServer parsedServer =
          httpServerParser.parseServer(
              setting.getStream(), startArgs.getPort(), toConfigs(setting));
      server = mergeServer(server, parsedServer);
    }

    return server;
  }