HAProxy community

Keep stick table entry when connection is active

We have an online mobile game using websocket for connections. Recently I setup haproxy for load balancing players across server samples. I use stick tables for tracking users connections and connect them to the same server they’re playing match in it.

The problem is stick table entries timeout start immediately after connection, so for example if I set table expire time to 30m and player keeps playing matches for 40 minutes and then disconnects, his entry is removed from the table and may reconnect to wrong server.

I temporarily solved this situation by setting expire to 6h. But the preferable option is to keep entries on the table while the connection is active.

Is there any way to hold expire timeout when connection is active or refresh it when there is activity on the connection?

Thank you in advance