.setNeedClientAuth(false)
);
// For both HTTP and HTTPS listeners: enable gzip compression, set thread pool, add listener to httpServer.
for (NetworkListener listener : new NetworkListener[] {httpListener, httpsListener}) {
CompressionConfig cc = listener.getCompressionConfig();
cc.setCompressionMode(CompressionConfig.CompressionMode.ON);
cc.setCompressionMinSize(50000); // the min number of bytes to compress
cc.setCompressableMimeTypes("application/json", "text/json"); // the mime types to compress
listener.getTransport().setWorkerThreadPoolConfig(threadPoolConfig);
httpServer.addListener(listener);
}
/* Add a few handlers (~= servlets) to the Grizzly server. */