Hi,

I work for 51Degrees, we provide a device database and detection software to 
get device information from the device's HTTP headers.  We have made a 
converter that can take a User-Agent header and create another header filled 
with device information to be sent to backend servers.

We've added documentation to the readme, but to summarise, to enable 51Degrees 
you need to get the 51Degrees C library 
(https://github.com/51Degreesmobi/51Degrees-C.git) and then run make with 
USE_51DEGREES and 51DEGREES_INC and 51DEGREES_SRC set.
51Degrees provide 2 different detection algorithms that are selected depending 
on what 51Degrees source code is passed to make.

1. Pattern - balances main memory usage and CPU.
2. Trie - a very high performance detection solution which uses more main 
memory than Pattern.

To make with the Pattern algorithm:

    $ make TARGET=linux26 USE_51DEGREES=1 
51DEGREES_INC='51D_REPO_PATH'/src/pattern 
51DEGREES_LIB='51D_REPO_PATH'/src/pattern

To make with the Trie algorithm:

    $ make TARGET=linux26 USE_51DEGREES=1 
51DEGREES_INC='51D_REPO_PATH'/src/trie 51DEGREES_LIB='51D_REPO_PATH'/src/trie

A data file containing information about devices, browsers, operating systems 
and their associated signatures is then needed. 51Degrees provide a free 
database in the repo for this purpose. These free data files are located in 
'51D_REPO_PATH'/data with the extensions .dat for Pattern data and .trie for 
Trie data.

The configuration file needs to set the following parameters:

51degrees-data-file                                        path to the pattern 
or trie data file
51degrees-property-name-list                  list of 51Degrees properties to 
detect (a full list here - https://51degrees.com/resources/property-dictionary)
51degrees-property-seperator                 separator to use between values

The following is an example of the settings for Pattern.

51degrees-data-file                                        
'51D_REPO_PATH'/data/51Degrees-Lite.dat
51degrees-property-name-list                  IsMobile ScreenPixelsWidth 
ScreenPixelsHeight
51degrees-property-seperator                 ,

The converter has the following config:
http-request set-header X-51D-MobileWidthHeight 
%[req.fhdr(User-Agent),51d(IsMobile,ScreenPixelsWidth,ScreenPixelsHeight)]

Converters take a maximum of 5 properties that were initialised in 
51degrees-property-name-list and will return a string of values in the same 
order as the properties were supplied.

I hope our code is up to the HAProxy standard. We're happy to make any changes 
needed.

Thanks,
Mike

This email and any attachments are confidential and may also be privileged. If 
you are not the named recipient, please notify the sender immediately and do 
not disclose, use, store or copy the information contained herein. This is an 
email from 51Degrees.mobi Limited, 5 Charlotte Close, Reading. RG47BY. T: +44 
118 328 7152; E: [email protected]; 51Degrees.mobi Limited t/as 51Degrees.

Attachment: 51degrees-patches.tgz
Description: 51degrees-patches.tgz

Reply via email to