peers / peerjs

Simple peer-to-peer with WebRTC.
https://peerjs.com
MIT License
12.48k stars 1.43k forks source link

Safari 14.1 connection closed on idle / screensaver #838

Closed newmediacrew closed 3 years ago

newmediacrew commented 3 years ago

Hi,

Everything is working fine until safari goes into "inactive" mode. You can reproduce this by opening a tab with peerjs running, then minimise or open another tab in safari, or continue in a chrome browser.

After a couple of minutes the time in between a heartbeat is send increases drastically. When this time in between reaches over a minute the connection is closed. See this image

On the server side peerjs is running as a system service: /usr/bin/peerjs --port 2087 --alive_timeout 600000 --path / --sslcert /etc/letsencrypt/live/xxx/fullchain.pem --sslkey /etc/letsencrypt/live/xxx/privkey.pem

Isn't alive_timeout suppose to increase the time before disconnect "Timeout for broken connection (milliseconds). If the server doesn't receive any data from client (includes pong messages), the client's connection will be destroyed."

Thanks

newmediacrew commented 3 years ago

This can be closed. We found a solution for this.