Hi Guillaume, Actually, I would use the payload(<offset>,<length>) function with offset = 0 and length = 10 and it should work :) Like: stick-table type binary len 10 size 30k expire 1h stick on payload(0,10)
it should do the job. Use socat and HAProxy stats socket to watch the result and print out the table. cheers cheers On Sat, Oct 6, 2012 at 6:36 PM, Guillaume Castagnino <[email protected]> wrote: > Le samedi 06 octobre 2012 17:11:31 kgardenia42 a écrit : >> Hi, > > Hi, > >> I have a custom TCP protocol I would like to load balance with >> haproxy. >> >> I'd like to implement a very simple stickiness algorithm based on the >> first (say) 10 bytes of client data (which contains a client >> identifier). Source ip stickiness is not reliable enough. >> >> Is this a common use-case? Has anyone else implemented this? In >> proto_tcp.c I can see what appears to be a protocol analyzer concept >> which looks in the ballpark of what I need. Does this seem the right >> way to go? Can anyone give me any pointers on how to get started? >> >> Thanks. > > I think you can inspire you with the SSL ID stickyness explained here to > stick on data contained in packets: > http://blog.exceliance.fr/2011/07/04/maintain-affinity-based-on-ssl- > session-id/ > > Instead of extracting the SSL ID, you extract your client identifier, > but this is more or less the same thing ! > > regards, > > -- > Guillaume Castagnino > [email protected] / [email protected] > >

