Search in sources :

Example 1 with StreamListener

use of org.webpieces.frontend2.api.StreamListener in project webpieces by deanhiller.

the class WebServerImpl method start.

@Override
public StreamListener start() {
    log.info("starting server");
    routingService.start();
    //validate html route id's and params on startup if 'org.webpieces.routeId.txt' exists
    validateRouteIdsFromHtmlFiles();
    FrontendConfig svrChanConfig = new FrontendConfig("http", config.getHttpListenAddress());
    svrChanConfig.asyncServerConfig.functionToConfigureBeforeBind = config.getFunctionToConfigureServerSocket();
    httpServer = serverMgr.createHttpServer(svrChanConfig, serverListener);
    httpServer.start();
    if (factory != null) {
        FrontendConfig secureChanConfig = new FrontendConfig("https", config.getHttpsListenAddress(), 10000);
        secureChanConfig.asyncServerConfig.functionToConfigureBeforeBind = config.getFunctionToConfigureServerSocket();
        httpsServer = serverMgr.createHttpsServer(secureChanConfig, serverListener, factory);
        httpsServer.start();
    } else {
        log.info("https port is disabled since configuration had no sslEngineFactory");
    }
    log.info("server started");
    return serverListener;
}
Also used : FrontendConfig(org.webpieces.frontend2.api.FrontendConfig)

Aggregations

FrontendConfig (org.webpieces.frontend2.api.FrontendConfig)1