eclipsesource / eclipsesource/cdtcloud-deploymentserver

[Bug]: WebSockets lose connection after a while

Open
#111 0 comments 0 reactions 0 assignees View on GitHub
bug DeviceConnector
Dominant language
TypeScript
Stars
4
Forks
4
PR merge metrics
No merged PRs in 30d

Description

### Current Behaviour

WebSockets of the DeviceConnector lose the connection to a remote DeploymentServer after a certain time of inactivity.
The reason for this is the default timeout in proxies and webservers of 30 seconds.

### Expected Behaviour

DeviceConnector should not disconnect and reconnect in such a short period.

### Source

_No response_

### Steps to reproduce the problem

1. Set the DeviceConnector's configuration to connect to a remote DeploymentServer
2. Watch it disconnect and reconnect

### Extra Notes

The easiest workaround right now is to simply set the timeout of the webserver to a higher value.

Configuration in Nginx to set the Timeout to 1 Day:
```conf
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
```

However, this workaround is not a solution when using a service like Cloudflare, as they have a default timeout of 100s set. A user cannot influence this in any way (Source: [stackoverflow](https://stackoverflow.com/questions/39668410/whats-disconnecting-my-websocket-connection-cloudflare-apaches-mod-proxy)).

A possible solution for the implementation might be to add a heartbeat to keep the connection alive and active by simply using the ping function and handling the pong answer.

### Code rev. hash/commit

a09070c

### Node version

16.13.0

### Operating system

Ubuntu 20.04

### Custom changes

None

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.