Examples
Prev | Chapter 16. HTTP server | Next

## Examples

Below are few examples for use in DSL based configuration format and older properties based format.

### HTTPS on port 8443 with SSL certificate for example.com

In configuration file `httpServer` related configuration should look like this:

    httpServer {
        connections {
            8443 () {
                socket = ssl
                domain = 'example.com'
            }
        }
    }

### Changing port from 8080 to 8081

    httpServer {
        connections {
            8080 (active: false) {}
            8081 () {}
        }
    }

### Usage of Jetty HTTP server as HTTP server

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.

#### Standalone

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) {
        ...
    }

#### OSGi

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.

### Note

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) {
        ...
    }

Prev | Up | Next
Configuration Properties | Home | Chapter 17. Tigase Message Archiving Component