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 createHttpServer(
      ImmutableList<SessionSetting> sessionSettings,
      Optional<Integer> port,
      MocoConfig... configs) {
    HttpServer server = ActualHttpServer.createLogServer(port, configs);
    for (SessionSetting session : sessionSettings) {
      logger.debug("Parse session: {}", session);

      session.bindTo(server);
    }

    return server;
  }
Exemplo n.º 3
0
 private HttpServer mergeServer(HttpServer server, HttpServer parsedServer) {
   ActualHttpServer thisServer = (ActualHttpServer) server;
   System.out.println("Merge Server :" + thisServer.isSecure());
   return thisServer.mergeHttpServer((ActualHttpServer) parsedServer);
 }