Good idea. You can also do it based on a sequence of ports accessed as well without headers/values which would allow you to forward directly to a tcp based service. You can track which ports are accessed and verify the sequence using stick-tables.
Here's an example of what that would look like:
https://gist.github.com/dcorbett-haproxy/ec7059cbfccf12c8f41...