var source = new EventSource(url); source.onopen = function() { console.log('opened'); }; source.onclose = function() { console.log('closed'); }; Reproduction steps: 1. Run the above code, where url points to a web page that supports SSE 2. Put your computer in sleep mode 3. Take your computer out of sleep mode 4. console.log(source.readyState == EventSource.CLOSED); // will print true The 'close' event should be fired because the connection was cancelled and the object's readyState was set to EventSource.CLOSED.