            } else if (e.readyState === EventSource.OPEN) {
                addMessage('Connection opened');
            } else if (e.readyState === EventSource.CLOSING) {
                addMessage('Connection closing');
            } else if (e.readyState === EventSource.CLOSED) {
                addMessage('Connection closed');
            }
        };
    } else {
        addMessage('Your browser does not support Server-Sent Events!');
    }
</script>
</body>
</html>