Willy Tarreau | b3cc9f2 | 2019-04-19 16:03:32 +0200 | [diff] [blame] | 1 | Scientiamobile WURFL Device Detection |
| 2 | ------------------------------------- |
| 3 | |
| 4 | You can also include WURFL for inbuilt device detection enabling attributes. |
| 5 | |
| 6 | WURFL is a high-performance and low-memory footprint mobile device detection |
| 7 | software component that can quickly and accurately detect over 500 capabilities |
| 8 | of visiting devices. It can differentiate between portable mobile devices, desktop devices, |
| 9 | SmartTVs and any other types of devices on which a web browser can be installed. |
| 10 | |
| 11 | In order to add WURFL device detection support, you would need to download Scientiamobile |
| 12 | InFuze C API and install it on your system. Refer to www.scientiamobile.com to obtain a valid |
| 13 | InFuze license. |
| 14 | Compile haproxy as shown : |
| 15 | |
| 16 | $ make TARGET=<target> USE_WURFL=1 |
| 17 | |
| 18 | Optionally WURFL_DEBUG=1 may be set to increase logs verbosity |
| 19 | |
Michael Prokop | 4438c60 | 2019-05-24 10:25:45 +0200 | [diff] [blame] | 20 | For HAProxy developers who need to verify that their changes didn't accidentally |
paulborile | cd9b9bd | 2019-04-18 12:31:25 +0200 | [diff] [blame] | 21 | break the WURFL code, it is possible to build a dummy library provided in the |
Willy Tarreau | 57610c6 | 2021-04-02 16:39:44 +0200 | [diff] [blame] | 22 | addons/wurfl/dummy directory and to use it as an alternative for the full library. |
paulborile | cd9b9bd | 2019-04-18 12:31:25 +0200 | [diff] [blame] | 23 | This will not provide the full functionalities, it will just allow haproxy to |
| 24 | start with a wurfl configuration, which generally is enough to validate API |
| 25 | changes : |
| 26 | |
Willy Tarreau | 57610c6 | 2021-04-02 16:39:44 +0200 | [diff] [blame] | 27 | $ make -C addons/wurfl/dummy |
| 28 | $ make TARGET=<target> USE_WURFL=1 WURFL_INC=$PWD/addons/wurfl/dummy WURFL_LIB=$PWD/addons/wurfl/dummy |
paulborile | cd9b9bd | 2019-04-18 12:31:25 +0200 | [diff] [blame] | 29 | |
Willy Tarreau | b3cc9f2 | 2019-04-19 16:03:32 +0200 | [diff] [blame] | 30 | These 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 Tarreau | b3cc9f2 | 2019-04-19 16:03:32 +0200 | [diff] [blame] | 36 | - wurfl-cache-size <string> (Sets the WURFL caching strategy) |
| 37 | - wurfl-patch-file [<file path>] (Sets the paths to custom WURFL patch files) |
| 38 | |
| 39 | Sample configuration : |
| 40 | |
| 41 | global |
paulborile | bad132c | 2019-04-18 11:57:04 +0200 | [diff] [blame] | 42 | wurfl-data-file /usr/share/wurfl/wurfl.zip |
Willy Tarreau | b3cc9f2 | 2019-04-19 16:03:32 +0200 | [diff] [blame] | 43 | |
| 44 | wurfl-information-list wurfl_id model_name |
| 45 | |
| 46 | #wurfl-information-list-separator | |
| 47 | |
Willy Tarreau | b3cc9f2 | 2019-04-19 16:03:32 +0200 | [diff] [blame] | 48 | ## 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 | |
| 60 | There are two distinct methods available to transmit the WURFL data downstream |
| 61 | to the target application: |
| 62 | |
| 63 | All data listed in wurfl-information-list |
| 64 | |
| 65 | http-request set-header X-WURFL-All %[wurfl-get-all()] |
| 66 | |
| 67 | A subset of data listed in wurfl-information-list |
| 68 | |
| 69 | http-request set-header X-WURFL-Properties %[wurfl-get(wurfl_id,is_tablet)] |
| 70 | |
| 71 | Please find more information about WURFL and the detection methods at https://www.scientiamobile.com |