blob: 3c28d19e46f525f67cca6b4a1e7b6dc7caeb8e6e [file] [log] [blame]
Willy Tarreaub3cc9f22019-04-19 16:03:32 +02001Scientiamobile WURFL Device Detection
2-------------------------------------
3
4You can also include WURFL for inbuilt device detection enabling attributes.
5
6WURFL is a high-performance and low-memory footprint mobile device detection
7software component that can quickly and accurately detect over 500 capabilities
8of visiting devices. It can differentiate between portable mobile devices, desktop devices,
9SmartTVs and any other types of devices on which a web browser can be installed.
10
11In order to add WURFL device detection support, you would need to download Scientiamobile
12InFuze C API and install it on your system. Refer to www.scientiamobile.com to obtain a valid
13InFuze license.
14Compile haproxy as shown :
15
16 $ make TARGET=<target> USE_WURFL=1
17
18Optionally WURFL_DEBUG=1 may be set to increase logs verbosity
19
Michael Prokop4438c602019-05-24 10:25:45 +020020For HAProxy developers who need to verify that their changes didn't accidentally
paulborilecd9b9bd2019-04-18 12:31:25 +020021break the WURFL code, it is possible to build a dummy library provided in the
22contrib/wurfl directory and to use it as an alternative for the full library.
23This will not provide the full functionalities, it will just allow haproxy to
24start with a wurfl configuration, which generally is enough to validate API
25changes :
26
27 $ make -C contrib/wurfl
28 $ make TARGET=<target> USE_WURFL=1 WURFL_INC=$PWD/contrib/wurfl WURFL_LIB=$PWD/contrib/wurfl
29
Willy Tarreaub3cc9f22019-04-19 16:03:32 +020030These are the supported WURFL directives (see doc/configuration.txt) :
31- wurfl-data-file <path to WURFL data file>
32- wurfl-information-list [<string>] (list of WURFL capabilities,
33 virtual capabilities, property names we plan to use in injected headers)
34- wurfl-information-list-separator <char> (character that will be
35 used to separate values in a response header, ',' by default).
Willy Tarreaub3cc9f22019-04-19 16:03:32 +020036- wurfl-cache-size <string> (Sets the WURFL caching strategy)
37- wurfl-patch-file [<file path>] (Sets the paths to custom WURFL patch files)
38
39Sample configuration :
40
41 global
paulborilebad132c2019-04-18 11:57:04 +020042 wurfl-data-file /usr/share/wurfl/wurfl.zip
Willy Tarreaub3cc9f22019-04-19 16:03:32 +020043
44 wurfl-information-list wurfl_id model_name
45
46 #wurfl-information-list-separator |
47
Willy Tarreaub3cc9f22019-04-19 16:03:32 +020048 ## single LRU cache
49 #wurfl-cache-size 100000
50 ## no cache
51 #wurfl-cache-size 0
52
53 #wurfl-patch-file <paths to custom patch files>
54
55 ...
56 frontend
57 bind *:8888
58 default_backend servers
59
60There are two distinct methods available to transmit the WURFL data downstream
61to the target application:
62
63All data listed in wurfl-information-list
64
65 http-request set-header X-WURFL-All %[wurfl-get-all()]
66
67A subset of data listed in wurfl-information-list
68
69 http-request set-header X-WURFL-Properties %[wurfl-get(wurfl_id,is_tablet)]
70
71Please find more information about WURFL and the detection methods at https://www.scientiamobile.com