ExploringApple
ExploringApple

Reputation: 1484

Websocket connection disconnects after few seconds

I have AWS ALB --> HAproxy --> web app ec2 set up.

When i use the url containing haproxy ip ex. ws://10.1.1.1:80/xxx The connections remains connected.

When I use ALB DNS in url ex. ws://<- ALB-DNS ->:80/xxx the connection connects and disconnects after few seconds.

I have enabled the session stickiness on target group(haproxy ec2 instances). Is there anything I am still missing? I am testing using http://www.websocket.org/echo.html

Upvotes: 0

Views: 993

Answers (1)

ExploringApple
ExploringApple

Reputation: 1484

I resolved the issue with the help of ALB logs (it's in s3 - have to configure)and HAproxy logs. There might be many possibilities for this reason: The actual state of the connection is not actually connected, but in the background, it looks for target group/haproxy server IP, request headers, proper configuration of HAproxy config. Also, make sure ALB health check are passing.

If any of this thing is not properly set this thing might happen.

Upvotes: 1

Related Questions