Hi Mike,

On Wed, Feb 25, 2015 at 09:41:35AM +0000, Mike Zoom wrote:
> Hi everyone!
> 
> I want to integrate a third party library, open source, under the Mozilla
> Public licence v2.
> 
> The main role of this library is to process an HTTP request header and to
> return a string which describes the client.

OK.

> Basically, we have the following questions:
> 1. how could we link our library in HAProxy at compilation time,

You just want this lib to be optional, as we do with zlib, openssl, pcre etc.
Just patch the makefile to add "USE_XYZ=1" to enable it, and possibly pass
"XYZ_INC" and "XYZ_LIB" to point to the libs' sources when they're not in the
system's default path.

> and 2. how
> could we write a new function in HAProxy which takes a buffer of data in
> entry and can return a string (or buffer of data)

I think that what you want to implement is a sample fetch function. For
example, take a look at the recently introduced "req.hdr_names" function,
which iterates over all request headers and produces a string that can be
used to build a log line, another header or whatever. I think it will be
straightforward enough for you to understand how to implement this with
your lib.

Best regards,
Willy


Reply via email to