---
name: "Eliom_config.server"
section: "3o"
platform: "linux"
package: "libeliom-ocaml-doc"
version: "4.0.0-2"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/Eliom_config.server"
---

# Eliom\_config.server(3o)

This module makes also possible get information from the configuration file.

## NAME

Eliom\_config - This module makes also possible get information from the configuration file.

## Module

Module   Eliom\_config

## Documentation

Module **Eliom\_config**\
  :  **sig end**

This module makes also possible get information from the configuration file.

It make also possible to add configuration options in configuration file for your Eliom modules. Use  **Eliom\_config.parse\_config** for that.

Example:

\<eliommodule ...\> \<myoption myattr="..."\>myvalue\</myoption\> \</eliommodule\>

*val get\_default\_hostname* :  **unit -\> string**

The function  **get\_default\_hostname ()** returns the hostname declared in the config file ( **\<host defaulthostname="..."\>** ) or the default machine hostname. In that case, absolute URL will use that hostname.

*val get\_default\_port* :  **unit -\> int**

The function  **get\_default\_port ()** returns the port number declared in the config file ( **\<host defaulthttpport="..."\>** ) or 80 if undeclared.

*val get\_default\_sslport* :  **unit -\> int**

The function  **get\_default\_sslport ()** returns the https port number declared in the config file ( **\<host** **defaulthttpsport="..."\>** ) or 443 if undeclared.

*val default\_protocol\_is\_https* :  **unit -\> bool**

The function  **default\_protocol\_is\_https ()** returns  **true** if there is option ( **\<host** **defaultprotocol="https"\>** )or false otherwise. In that case, absolute links will use https protocol even if the current request is http.

*val get\_config\_default\_charset* :  **unit -\> string**

The function  **get\_config\_default\_charset ()** returns the default charset for this site.

*val set\_default\_links\_xhr* :  **?override\_configfile:bool -\> bool -\> unit**

The provided value serves as a default value for the optional parameter **~xhr** in the functions  **Eliom\_registration.\*.{a, get\_form, post\_form,** **lwt\_get\_form, lwt\_post\_form}** (cf.  **Eliom\_registration.Html5.a** et al.). This value can also be set in the config file.

*val get\_config* :  **unit -\> Simplexmlparser.xml list**

The function  **get\_config ()** returns the information of the configuration file concerning that site (between  **\<eliommodule\>** and **\</eliommodule\>** or  **\<eliom\>** and  **\</eliom\>** ).

Warning: You must call that function during the initialisation of your module (not during a Lwt thread or a service) otherwise it will raise the exception **Eliom\_common.Eliom\_site\_information\_not\_available** . If you want to build a statically linkable module, you must call this function inside the initialisation function given to **Eliom\_service.register\_eliom\_module** .

*val parse\_config* :  **?pcdata:(string -\> unit) -\>** **?other\_elements:(string -\>** **(string \* string) list -\> Simplexmlparser.xml list -\> unit) -\>** **Ocsigen\_extensions.Configuration.element list -\> unit**

Process the configuration (same as the one returned by ) by a given specification (cf. )

*val get\_config\_info* :  **unit -\> Ocsigen\_extensions.config\_info**

The function  **get\_config\_info ()** returns the information concerning the current request from the configuration files (must be called during a request). The configuration may have been modified by previous Ocsigen server extensions.
