Websockets configuration in HAProxy
I having setup a HAproxy on Pfsense - for handling our incomming request to webpages.
One of the sites are running Qlik
I'm struggling since the server is using websockets.
I can find other guides on using HAProxy directly - as described Here
I'm not running as Loadbalancing since the setup is a testsetup - for development on our Qlik server.
But what I do not get and do not know where to configure - is these lines:
## routing based on Host header acl host_ws hdr_beg(Host) -i ws. use_backend bk_ws if host_ws ## routing based on websocket protocol header acl hdr_connection_upgrade hdr(Connection) -i upgrade acl hdr_upgrade_websocket hdr(Upgrade) -i websocket use_backend bk_ws if hdr_connection_upgrade hdr_upgrade_websocket default_backend bk_web
I cannot find where and how to create these Actions since i cannot se the option for how to create these settings. Since Qlik is using websockets - we get a timeout - can refresh and the page are loading - But if I press refresh it'll load the page.
I've look in generel, frontends and backends but cannot find anywhere I can configure these lines
Buit I would like the setup to run as smooth as possible without these timeouts
You should be able to create the acl's like this:
The 'hdr_beg' looks a bit different than what is generated in the config, but should have the same effect as the '-m beg'. As for the 'use-backend' actions, i guess you can figure that part out? If not ill make a little screenshot that part as well.
This is just what I have been looking for I have been trying to workout how to do this with bitwarden_rs
Any chance you could share your a more full screenshot of the backend part too?
@clumbo Did you happen to make it work with bitwarden_rs? I'm here for the same reason struggling with this issue :)
Hey dude, I've found my solution here: https://github.com/dani-garcia/bitwarden_rs/wiki/Proxy-examples
I've started to use "HAproxy (by @williamdes)" and it looks like this:
Hope this helps..
yes it does thanks!
but what I cant get my head around is why I need two different backends...
how do your backend configs look like? specifically the ws backend. Isnt it the same port?! or is there some magic going on ?
Yes, it is built upon two different services. One that handles everything except notifications, which is handled by a different service on port 3012.
Take a look here:
I have two backends that point to the same IP address but different port 80 and 3012.
If you do not enable notifications then you do not need the additional config :)
Well still struggling a whole lot with this websocket and how to configure my proxy for using the Qlik server
As configured Backend - it looks like this:
And the frontend are configured as this
But are not getting through to the server at all - just getting error 503
But am I doing this wrong - is the custom ACL placed under the backend or frontend ( The same input are available both places) - and since this is the first I have a site using websockets - so not sure if this is configured totally wrong ?