How to get same functionality as nginx sticky route directive


#1

I am using docker to setup some websocket chat service. I have a chat-load-balancer service and a chat service.

Now when I do dig chat I get a list of fixed ip’s but every time I call that command the order is randomized. My chat is stateful and build using sockjs. The connection made to the websocket chat server has ?chatName=xxx in it.

Now I want to have every client which connects to chatName=xxx to always connect to the same ip, no matter what the order of the ip’s in the chat service is. So I need a routing of chatName=xxx to a fixed ip from the list which I get from dig chat, no matter what the order of ip’s are returned.

In nginx I can get this result by using the sticky route directive in upstream module. But this is only available in the commercial subscription.