Below are few examples for use in DSL based configuration format and older properties based format.
In configuration file httpServer
related configuration should look like this:
httpServer { connections { 8443 () { socket = ssl domain = 'example.com' } } }
As mentioned before it is possible to use Jetty as HTTP server for improved performance. Jetty API can be used in one of two forms: Standalone and OSGi.
In this case the Jetty instance is created and configured internally by Tigase HTTP API. This allows for the same configuration properties used as for default HTTP server configuration.
Configuration with use of standalone Jetty HTTP Server.
httpServer (class: tigase.http.jetty.JettyStandaloneHttpServer) { ... }
If Jetty HTTP server is used in standalone mode, JDK which Tigase is using is newer then JDK 8 and HTTP server is configured to serve data over encrypted (ssl
or tls
) connections then HTTP/2 will be enabled by default.
However it is possible to disable HTTP/2 by setting use-http2
property of encrypted port to false
, ie. for port 8443:
httpServer (class: tigase.http.jetty.JettyStandaloneHttpServer) { ... '8443' () { socket = ssl 'use-http2' = false } }
This can only be used when Tigase is running inside OSGi container. If this is used Tigase HTTP API will try to retrieve Jetty HTTP server from OSGi container and use it.
Jetty HTTP server instance is not configured by Tigase. We would only use this instance for deployment.
Configuration in OSGi mode with use of Jetty HTTP Server.
httpServer (class: tigase.http.jetty.JettyOSGiHttpServer) { ... }