scientiamobile | d0027ed | 2016-11-04 10:55:08 +0100 | [diff] [blame] | 1 | Scientiamobile WURFL Device Detection |
Willy Tarreau | 29b2531 | 2016-11-08 14:57:29 +0100 | [diff] [blame] | 2 | ------------------------------------- |
scientiamobile | d0027ed | 2016-11-04 10:55:08 +0100 | [diff] [blame] | 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 | |
| 20 | These are the supported WURFL directives (see doc/configuration.txt) : |
| 21 | - wurfl-data-file <path to WURFL data file> |
| 22 | - wurfl-information-list [<string>] (list of WURFL capabilities, |
| 23 | virtual capabilities, property names we plan to use in injected headers) |
| 24 | - wurfl-information-list-separator <char> (character that will be |
| 25 | used to separate values in a response header, ',' by default). |
| 26 | - wurfl-engine-mode <string> (Sets the WURFL engine target. You can choose |
| 27 | between "accuracy" and "performance","performance" by default) |
| 28 | - wurfl-cache-size <string> (Sets the WURFL caching strategy) |
| 29 | - wurfl-patch-file [<file path>] (Sets the paths to custom WURFL patch files) |
| 30 | |
| 31 | Sample configuration : |
| 32 | |
| 33 | global |
| 34 | wurfl-data-file /usr/share/wurfl/wurfl-eval.xml |
| 35 | |
| 36 | wurfl-information-list wurfl_id model_name |
| 37 | |
| 38 | #wurfl-information-list-separator | |
| 39 | |
| 40 | wurfl-engine-mode performance |
| 41 | #wurfl-engine-mode accuracy |
| 42 | |
| 43 | ## double LRU cache |
| 44 | wurfl-cache-size 100000,30000 |
| 45 | ## single LRU cache |
| 46 | #wurfl-cache-size 100000 |
| 47 | ## no cache |
| 48 | #wurfl-cache-size 0 |
| 49 | |
| 50 | #wurfl-patch-file <paths to custom patch files> |
| 51 | |
| 52 | ... |
| 53 | frontend |
| 54 | bind *:8888 |
| 55 | default_backend servers |
| 56 | |
| 57 | There are two distinct methods available to transmit the WURFL data downstream |
| 58 | to the target application: |
| 59 | |
| 60 | All data listed in wurfl-information-list |
| 61 | |
| 62 | http-request set-header X-WURFL-All %[wurfl-get-all()] |
| 63 | |
| 64 | A subset of data listed in wurfl-information-list |
| 65 | |
| 66 | http-request set-header X-WURFL-Properties %[wurfl-get(wurfl_id,is_tablet)] |
| 67 | |
| 68 | Please find more information about WURFL and the detection methods at https://www.scientiamobile.com |