users@grizzly.java.net

Re: HAProxy with grizzly's websocket how

From: ImiG <imre.fazekas_at_gmail.com>
Date: Mon, 19 Mar 2012 11:54:48 +0100

Hello,


Interesting thread… Thank you, will try it very soon!


Regards,

Imre

2012.03.19. dátummal, 11:51 idõpontban Oleksiy Stashok írta:

> Hi Imre,
>
> according to this thread [1], it's suggested to use stunnel in front of HAProxy.
>
> WBR,
> Alexey.
>
> [1] http://www.serverphorums.com/read.php?10,139026
> On 03/18/2012 07:48 PM, Imre Fazekas wrote:
>> Seems working for non-secure-based connections. HAProxy is working.
>>
>> But for secure-based wss, it doesn't . Any idea or any experience with other load balancers?
>>
>>
>> Thanks,
>>
>> Imre
>>
>>> Dear All,
>>>
>>>
>>> I try to load balance websockets-based services of grizzly servers running on port 7777, but failed to do it with HAProxy 1.4.20.
>>>
>>> Following the page by Jean-Francois: http://jfarcand.wordpress.com/2011/10/06/configuring-haproxy-for-websocket/, it is not working.
>>>
>>> Connection refused for my wss -based connections. Work when reaching the servers directly but not when through the HAProxy. Connection refused, :(
>>>
>>> Had anybody luck with HAProxy and Grizzly web socket?
>>>
>>>
>>>
>>> Thank you in advance!
>>>
>>> Regards,
>>>
>>> Imre
>>>
>>> ps
>>> haproxy config:
>>>
>>> global
>>> maxconn 4096 # Total Max Connections. This is dependent on ulimit
>>> nbproc 1
>>>
>>> defaults
>>> mode http
>>>
>>> frontend all 96.126.127.206:80
>>> timeout client 86400000
>>> default_backend www_backend
>>> acl is_websocket hdr(Upgrade) -i WebSocket
>>> acl is_websocket hdr_beg(Host) -i ws
>>>
>>> use_backend socket_backend if is_websocket
>>>
>>> backend www_backend
>>> balance roundrobin
>>> option forwardfor # This sets X-Forwarded-For
>>> timeout server 30000
>>> timeout connect 4000
>>> server chatserver 127.0.0.1:8080 weight 1 maxconn 1024 check
>>>
>>> backend socket_backend
>>> balance roundrobin
>>> option forwardfor # This sets X-Forwarded-For
>>> timeout queue 5000
>>> timeout server 86400000
>>> timeout connect 86400000
>>> server chatserver 127.0.0.1:7777 weight 1 maxconn 1024 check
>>>
>>>
>>>
>>>
>