if (httpContext instanceof ContextHandlerHttpContext contextHandlerHttpContext) {
// TODO stop handler first?
// FIXME understand compatibility with Jetty 12
- //contextHandlerCollection.removeHandler(contextHandlerHttpContext.getServletContextHandler());
+ // contextHandlerCollection.removeHandler(contextHandlerHttpContext.getServletContextHandler());
} else {
// FIXME apparently servlets cannot be removed in Jetty, we should replace the
// handler
}
private String httpPortsMsg() {
+ String hostStr = getHost();
+ hostStr = hostStr == null ? "*:" : hostStr + ":";
+ return (httpConnector != null ? "# HTTP " + hostStr + getHttpPort() + " " : "")
+ + (httpsConnector != null ? "# HTTPS " + hostStr + getHttpsPort() : "");
+ }
- return (httpConnector != null ? "HTTP " + getHttpPort() + " " : "")
- + (httpsConnector != null ? "HTTPS " + getHttpsPort() : "");
+ public String getHost() {
+ if (httpConnector == null)
+ return null;
+ return httpConnector.getHost();
}
public Integer getHttpPort() {
// start
sshd.start();
- log.debug(() -> "CMS SSH server started on port " + port + (host != null ? " of host " + host : ""));
+ log.info("# SSH " + (host != null ? host + ":" : "*:") + port);
} catch (IOException e) {
throw new RuntimeException("Cannot start SSH server on port " + port, e);
}