nchan
nchan copied to clipboard
WebSocket Closing
I have a HA setup with Nchan (Redis Clusters + Load balancer with multiple EC2 Instances).
But When I subscribe to a channel using websocket, The Socket Connection is getting closed after 60 seconds.
I thought of doing a HeartBeat call every 60 seconds while subscribed to a channel but it doesn't allow it since the route is only for subscribing and not publishing(makes sense).
I tried increasing the timeout to 3600 in the load balancer , but the connection is getting closed after 5 minutes. we might need active connection for more than 2 hours.
(Also this was not an issue when nchan was installed in single machine without loadbalancer)
Any Suggestions / Fix ?
Update: Switched to SSE and added these directives
nchan_eventsource_ping_data "heartbeat"; nchan_eventsource_ping_interval 2;
but with Websockets, the below directive is not sending ping every x number of seconds nchan_websocket_ping_interval 2;