Search in sources :

Example 1 with HttpHandler

use of de.tectoast.emolga.jetty.HttpHandler in project Emolga by TecToast.

the class EmolgaMain method setupJetty.

private static void setupJetty() throws Exception {
    Server server = new Server();
    HttpConfiguration http_config = new HttpConfiguration();
    http_config.setSecureScheme("https");
    http_config.setSecurePort(51216);
    http_config.setOutputBufferSize(32768);
    SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
    sslContextFactory.setSslContext(getContext());
    HttpConfiguration https_config = new HttpConfiguration(http_config);
    SecureRequestCustomizer src = new SecureRequestCustomizer();
    src.setStsMaxAge(2000);
    src.setStsIncludeSubDomains(true);
    https_config.addCustomizer(src);
    ServerConnector https = new ServerConnector(server, new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(https_config));
    https.setPort(51216);
    https.setIdleTimeout(500000);
    server.setConnectors(new Connector[] { https });
    server.setHandler(new HttpHandler());
    server.start();
}
Also used : HttpHandler(de.tectoast.emolga.jetty.HttpHandler) SslContextFactory(org.eclipse.jetty.util.ssl.SslContextFactory)

Aggregations

HttpHandler (de.tectoast.emolga.jetty.HttpHandler)1 SslContextFactory (org.eclipse.jetty.util.ssl.SslContextFactory)1