WURFL InFuze
The WURFL module provides device detection services using the ScientiaMobile InFuze database.
Install the WURFL module
Log into your account at the ScientiaMobile website and subscribing for WURFL InFuze. Follow the installation instructions in the WURFL InFuze for C: User Guide to install the API on your HAProxy Enterprise server.
Copy the WURFL InFuze device detection database (XML file) to the HAProxy Enterprise server (e.g. /etc/hapee-1.9/wurfl.xml).
-
Install the DeviceAtlas module according to your platform:
$ # On Debian/Ubuntu $ sudo apt-get install hapee-1.9r1-lb-wurfl
$ # On CentOS/RedHat/Oracle $ sudo yum install hapee-1.9r1-lb-wurfl
$ # On SUSE $ sudo zypper install hapee-1.9r1-lb-wurfl
$ # On FreeBSD $ sudo pkg install hapee-1.9r1-lb-wurfl
-
Add the following to the
global
section of the HAProxy Enterprise configuration file:global module-load hapee-lb-wurfl.so wurfl-data-file
/etc/hapee-1.9/wurfl.xmlwurfl-information-list wurfl_id model_name wurfl-cache-size 100000 Reload the HAProxy Enterprise configuration to apply the changes.
Global directives
The global
section supports the following directives for the hapee-lb-wurfl
module:
Directive | Description |
---|---|
| Required. The path to the WURFL data file. |
| Required. List of WURFL capabilities, virtual capabilities, and property names to use in injected HTTP headers. Separate each value with a space. See the WURFL InFuze documentation for values that you can use. |
| Separator to add between data returned from the WURFL database. Defaults to ",". |
| Lists the file paths to WURFL patch definitions. You can have as many as necessary, and the API applies them in the order they appear in the configuration file. Separate each value with a space. |
| The LRU cache speeds up lookup operations on User-Agent strings that were previously processed. This directive sets the number of entries to keep in the cache.
|
| WURFL engine target (requires WURFL version < 1.9):
|
| Tells WURFL whether to prioritize the use of the plain user agent ( |
Fetches and converters
wurfl-get
Use the fetch method wurfl-get
to perform a lookup in the database that returns the values of the specified properties. You must declare these properties beforehand with the wurfl-information-list
global directive.
Syntax
wurfl-get(<prop>[,<prop>*])
Create an HTTP request header that contains device information
frontend www
bind :80
mode http
http-request set-header X-WURFL-Properties %[wurfl-get(wurfl_id,model_name)]
wurfl-get-all
Use the fetch method wurfl-get-all
to perform a lookup in the database that returns values for all properties that the wurfl-information-list
directive declared.
Syntax
wurfl-get-all()
Create an HTTP request header that contains all the device properties
frontend www
bind :80
mode http
http-request set-header X-WURFL-All %[wurfl-get-all()]
Update the database during runtime
Use the WURFL Update module to keep contents of the device detection database current. This allows you to keep multiple instances of HAProxy Enterprise synced with the latest data.
Install a Web server of your choice and host the database file at a URL where HAProxy Enterprise can access. For example, host the file at http://192.168.122.1:8000/wurfl.xml.gz.
-
Install the package
hapee-1.9r1-lb-wurfl-update
:$ # On Debian/Ubuntu $ sudo apt-get install hapee-1.9r1-lb-wurfl-update
$ # On CentOS/RedHat/Oracle $ sudo yum install hapee-1.9r1-lb-wurfl-update
$ # On SUSE $ sudo zypper install hapee-1.9r1-lb-wurfl-update
$ # On FreeBSD $ sudo pkg install hapee-1.9r1-lb-wurfl-update
-
In the
global
section of your configuration, add directives similar to the following example:global module-load hapee-lb-wurfl-update.so wurfl-update url
http://192.168.122.1:8000/wurfl.xml.gz delay 24h logWith this configuration, HAProxy Enterprise downloads the database every 24 hours and displays a message in the logs when it succeeds, or when it encounters an error during the update.
wurfl-update
The wurfl-update
directive enables updating the database over HTTP from a specified URL. Updating a database with a newer version invalidates any cached lookups (if caching is used), unless you enable checksum
and the new and old database contents are identical.
The directive supports the following syntax:
wurfl-update url <url>
[delay <u> | xdelay <u s b r>]
[timeout <t>]
[retries <n>]
[checksum | modified]
[hash]
[source <addr>[:<port>]]
[log]
[dontlog-normal]
[param*]
where:
| Required. Specifies the database update URL. |
| Specifies the period between each attempt to download a new database version. The delay is a simplified version of the |
|
|
| Specifies the HTTP connection timeout in milliseconds (default) for attempts to download a new database version.
|
| Specifies the number of retries to download a new WURFL database version. If not set, the global |
| If set, this determines the use of the |
| If set, enables authentication of the downloaded data.
|
| Specifies the use of the time from the |
| Sets the source address for outgoing connections.
|
| Specifies whether to log operation errors. |
| Deactivates logging of successful updates. |
| Lists other server parameters that are useful for configuring SSL features. |
wurfl-debug
Sets the debug level. The default is 7. Use this only when the module runs in debug mode; in normal use, it has no significance.
The directive supports the following syntax:
wurfl-debug <level>
Runtime API
The following Runtime API commands are available:
| Sets the debug level (default: 7). This command is usable only when you compile the module in debug mode; it has no significance in normal use. |
| Provides instrumentation to describe memory space usage. If the |
| Shows the WURFL Update configuration. |
| Shows the module status. |
| Launches an update manually. |
Next up
Geolocation