Advanced Configuration

The HTTP component has a variety of configuration options, lets see them in detail here

Component Properties

Please note, for settings mentioning {compname} replace them with the exact text found as --comp-name, which may be http, rest, or something you have set custom in init.properties.

{compname}/http/ports[i]=8088,8096
Sets a comma separated list of ports on which the HTTP server listens for connections. 8080 is set by default.
{compname}/2222/socket=ssl
Sets the port you wish the HTTP server to listen to for HTTPS connections to 2222
{compname}/4096/domain=example.com
Sets 4096 as the port number you want to listen to HTTPS connections AND set the domain name of the SSL certificate from Tigase XMPP server certificate store to be used.
{compname}/server-class=

Sets the name of the class used to manage the HTTP server. The following names may be used

  • tigase.http.jetty.JettyStandaloneHttpServer - starts standalone Jetty HTTP Server instance (requires Tigase HTTP API - Jetty HTTP Server)
  • tigase.http.jetty.JettyOSGiHttpServer - uses Jetty HTTP Server instance available as OSGi service (may be used only in OSGi envoirment) (requires Tigase HTTP API - Jetty HTTP Server)
  • tigase.http.java.JavaStandaloneHttpServer - uses HttpServer provided by Java JDK to start standalone HTTP server (may not work on JDK from every JDK provider)
{compname}/http/port
An older version of the /ports[i] setting, it is still supported, but expect to be phased out.
{compname}/setup/admin-credentials
Sets a user and password combination that can access the web installer setup pages. By default administrator JIDs listed in --admins property are granted access, however you may specifiy a specific user and password to give access in addition to those JIDs. Format is [username:password] So for example, http/setup/admin-credentials=admin:password Note that this stores the information in plaintext on init.properties file, and this is an optional setting.
Modules

Tigase HTTP API component provides functionalities as modules which may be enabled or disabled and configured separately. Common settings for modules which can be passed in component properties in following format component_name/module_id/module_setting:

  • active[B]= Values true/false to enable or disable module
  • context-path= Path of HTTP context under which module should be available
  • vhosts[s]= Comma separated list of virtual hosts under which the module should be availble. If this setting is not set, the HTTP module will be available for all virtual hosts.

With those ideas in mind, lets look at the available modules for the HTTP API.

Rest Module

This module provides support for the REST API. enable it by using this line in the init.properties file:

http/RestModule/active[B]=true

Assuming that comp-name for the class is http

rest-scripts-dir=
Path to directory containing scripts processing REST requests. By default this directory is scripts/rest
api-keys[s]=
Comma separated list of strings which would be possible to use as keys to pass api-key parameter to request an authorization to execute. If nothing is passed, then no request will be allowed. To allow any request, this property needs to be set to open_access.
DNS Webservice Module

dns-webservice module provides support for resolution of DNS names using the HTTP protocol. This might be useful for web applications that need to resolve DNS address to a specific IP. For example, discover IP and port of WebSocket service to use to connect to XMPP server.

To activate this module, use the following line;

http/dns-webservice/active[B]=true

Assuming that comp-name for the class is http