Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Maintaining Websocket Connections with Load Balancer on GCP

I have a load balancer set up on GCP to distribute traffic between instances, but I'm facing an issue with maintaining websocket connections when clients are directed to different instances. Is there a solution that would allow clients to join websocket rooms that were created on different instances?

Solved Solved
0 1 3,995
1 ACCEPTED SOLUTION

Hi @rohan_kamble ,

If you are looking for this kind of option, allowing clients to join websockets created on a different instance, there should be a load balancer as well on that instance. There is a parameter available for load balancer that allows you to do that using Session Affinity

View solution in original post

1 REPLY 1

Hi @rohan_kamble ,

If you are looking for this kind of option, allowing clients to join websockets created on a different instance, there should be a load balancer as well on that instance. There is a parameter available for load balancer that allows you to do that using Session Affinity