HAProxy community

LUA and UDP sockets



Just wondering if anyone here has managed to send UDP packets from within a LUA script. What I’m trying to do is have lua send a counter to graphite via a UDP datagram in order to collect metrics for particular requests.

I’m successfully using lua to select a back end based on properties of the request body (don’t ask) and the icing on the cake would be to ping graphite with a counter via a UDP datagram for the ops team.

I’ve looked at the HAProxy lua socket object and this appears to be tcp only… or failing that, I’m just not reading the docs properly.




Lua in HAProxy is not able to send UDP. Maybe ater, when HAProxy will support UDP.

Note that send ing UDP is not a bloking action, so maybe you can try to se the standard Lua socket and use UDP, but only UDP, if you try to use TCP, haproxy will fail.