Hi folks, this is just a quick mail to let you know that I've just merged the recent work from my coworker Thierry Fournier (in Cc) about supporting Lua scripting in haproxy. I won't go into lengths explaining how that's supposed to be used because I don't really know myself, but I'll let him provide some explanations and working examples. The real purpose would be to get some feedback, suggestions, criticisms to get further into this.
At the moment it is possible to declare some Lua-based sample fetch functions, some converters as well and even to create new tcp-request and http-req/resp actions. These last ones (the actions) support yielding so that it is possible to make blocking calls from the Lua code and benefit from haproxy's native session management and scheduling to switch to something else while things are making progress. Thus the whole system is totally non-blocking and event-driven, even if in Lua you appear to be blocking. The long term goal is to be able to quickly provide some features that are not yet possible natively, and eventually to implement some of them natively if they're often requested or have a performance impact. Some of the most complex parts such as writing authentication systems relying on side-traffic would possibly remain written in Lua only, except if we manage to see a big use of certain things and we see a way to implement them cleanly. Thierry is busy these days, and that's why I asked him to push his code prior to switching to other tasks despite the doc not being there yet. So it's possible we'll have to wait a bit for some doc, but we'll really value testing, bug reports and feedback. Nothing is set in stone yet, he does have some ideas on how to improve things. I do still have some concerns about long-term stability and resource usage, as you can expect. So use it as a toy first, play with it and tell us if you like it or not, and if not, why. Thanks! Willy