'Web socket listening issue on AWS Application Load Balancer

We are using AWS load balancer for our website, We have configured below,

  1. Two client instances (client-A and client-B) for Front-End
  2. Two server instances (server-A and server-B) for Back-end

If we use 2 instances for the client & single instance for the server, then every WebSocket Subscription is working fine

But if we switch it into 2 clients with 2 server instances, then the WebSocket subscriptions are not working at all.

Is there any methods available to handle web-socket using Load Balancer on AWS? If yes, how to sort out this issue and also we want to know for which instance the WebSocket request is entering and from which instance the response is coming out.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source