HAProxy layer 7 health check to Ratchet

320 views
Skip to first unread message

Chris Clark

unread,
Dec 23, 2013, 11:25:03 AM12/23/13
to ratch...@googlegroups.com
Hi

I have set ratchet up like in http://socketo.me/docs/deploy with HAProxy dynamically sending websocket traffic to ratchet and have it working great (Execpt for some reason i cant get websockets to work over port 80 but that looks like an Amazon EC2 issue).

I now want to add a layer 7 health check to my websocket servers but i can seem to get it to work. 
I used the health check from this (http://blog.exceliance.fr/2012/11/07/websockets-load-balancing-with-haproxy/) blog post but updated with my domain but cant seem to get it to work. Ratchet keeps returning 400.

option httpchk GET / HTTP/1.1\r\nHost:\ ws.domain.com\r\nConnection:\ Upgrade\r\nUpgrade:\ websocket\r\nSec-WebSocket-Key:\ haproxy\r\nSec-WebSocket-Version:\ 13\r\nSec-WebSocket-Protocol:\ echo-protocol
http-check expect status 101

Has any one done this before or have any info that may help?

Thanks,

Oscar Balladares

unread,
Dec 23, 2013, 4:13:54 PM12/23/13
to ratch...@googlegroups.com
Maybe you have an Nginx or Apache process running on port 80.

I set up once a similar environment, a websocket app and a http app in the same box and in the "same port" (as seen for the final user)
Both reachable on port 80 but in the front there was HAproxy listening, if an "upgrade" header was sent it forwarded
the request to the socket server (running in, eg, port 1337); otherwise it routed to an Nginx server running on port 8080 in the background.

I did it on a EC2 with no extra configuration beyond installing OS packages/libs.

Regards.

Chris Clark

unread,
Dec 23, 2013, 4:31:35 PM12/23/13
to ratch...@googlegroups.com
Thanks for the help. I have checked netstat and cant seem to find anything else. I am not too concerned though because i am hoping to move move my installation to Docker (http://docker.io) once I have it working the way I want it. That should sort the issue out.

Did you by any chance manage to get a Layer 7 health check working for websockets with the installation you mentioned?

Thanks again.

Chris Clark

unread,
Dec 24, 2013, 4:48:48 AM12/24/13
to ratch...@googlegroups.com
Just in case anyone else has port 80 issues i found that the issue was with the network of my client machine. Some networks have issues handling the Upgrade request. See this post https://forums.aws.amazon.com/thread.jspa?messageID=512103&#512103

Thanks,
Reply all
Reply to author
Forward
0 new messages