live-server icon indicating copy to clipboard operation
live-server copied to clipboard

Keep WS connection alive/open (timeout, ping)

Open penge opened this issue 4 years ago • 0 comments

live-server: 1.2.1 nodejs: 10.15.3

WebSocket connection can timeout and be closed due to inactivity, in my case (Cloud9) after 30 seconds. More here: https://stackoverflow.com/questions/9056159/websocket-closing-connection-automatically and https://community.c9.io/t/websocket-support/14044

Due to this, live-reload will stop working if opened file is updated after 30 seconds since its last update (or since it was opened).

Solution: ping/pong to keep connection alive, and possibly make it configurable via option --ping with default let's say 15 seconds.

penge avatar Aug 12 '19 05:08 penge