Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4751

Matching TCP payloads is not working

$
0
0

@dsfh2992 wrote:

OK, so I have a TCP application where the client sends a string as soon as it connects. I want to direct the client to a different backend depending on the content of that string. The string can vary in length between 330 - 420 characters or so (it's a line of JSON).

I am working with a config like this:

frontend TEST_front
   bind *:51090
   mode tcp
   tcp-request inspect-delay 5s
   tcp-request content accept if WAIT_END
   option tcplog
   acl testacl payload(0,400) -m sub lon
   use_backend TEST_back_2 if testacl
   use_backend TEST_back

So, this works if the string "lon" is found in the first 400 characters and the line is 400 characters or longer. (and yes, I've tried using "req.payload(0,400)", same thing. If the line is less than 400 characters, it does NOT set the ACL to "true".

Since I never know exactly how long the line will be, or where in the line the text will appear, I am not able to get this to work consistently. I have also tried payload(0,0), but that does not seem to work either.

Any suggestions?

Thanks.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>