Websocket apps disconnecting when going through HAProxy

Hello people,

i got some trouble with websocket applications behind haproxy.
I can connect to the applications without any problems but after a shot periode of time (4-5 seconds) the applications says “disconnected” (in different flavors deppends on the application ;)). The Applications for example are: Estos ProCall (uses Websocket for mobile app communication), Innovaphone myApps (does everything with websocket) and NodeRed.

The HAProxy Log doesn´t show anything (severity “info”). NodeRed says “connection lost” but there is no entry in haproxy log. I read a lot about other people having a similar issue, but non of the suggested solution seems to help.

Here my config:

#---------------------------------------------------------------------
# Global Parameters
#---------------------------------------------------------------------

global
        log                             127.0.0.1:514  local0 notice
        pidfile                         /var/run/haproxy.pid
        maxconn                         4096
        daemon
        log                             127.0.0.1 local0 debug
        ssl-server-verify               none

#---------------------------------------------------------------------
# Default Parameters
#---------------------------------------------------------------------

defaults
        mode                    http
        log                     global
        option                  httplog
        option                  http-server-close
        option forwardfor       except 127.0.0.0/8
        option                  redispatch
        retries                 3
        timeout http-request    15s
        timeout queue           30s
        timeout connect         5s
        timeout client          5000
        timeout server          25s
        timeout http-keep-alive 1s
        timeout check           10s
        timeout tunnel          3600s
        timeout tarpit          60s


#---------------------------------------------------------------------
# Frontend Redirect 80->443 WAN Interface
#---------------------------------------------------------------------

frontend http_redirect_wan
        bind                   ip.add.re.ss:80
        redirect                scheme https code 301 if !{ ssl_fc }

#---------------------------------------------------------------------
# Frontend Application LAN Interface
#---------------------------------------------------------------------

frontend https_lan
        mode                    http
        bind                    ip.add.re.ss:443 ssl crt ***.pem
        option                  forwardfor              header          X-Real-IP
        http-request            set-header              X-Real-IP %[src]


        #---------------------------------------------------------------------
        # Frontend Application ACLs
        #---------------------------------------------------------------------

        acl                     acl_red                 ssl_fc_sni      red.example.de


        #---------------------------------------------------------------------
        # Backend Forwarding
        #---------------------------------------------------------------------


        use_backend             lan-l-app03_nodered     if              acl_red


#---------------------------------------------------------------------
# Backend Definitions
#---------------------------------------------------------------------


backend lan-l-app03_nodered
        server                  lan-l-app03_nodered     ip.add.re.ss:1880 check
        timeout                 server                  500m
        timeout                 connect                 500m
        timeout                 queue                   500m
        cookie                  io prefix indirect nocache


Dont get nervous about the timeouts, i tried a lot :wink:

Hope anybody can give me a suggestion :slight_smile:

Thanks in advance!