<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <title>Live Update</title>
    <script src="https://cdn.socket.io/4.6.1/socket.io.min.js"></script>
</head>
<body>
    <h2>Daten vom Server</h2>
    <p><strong>Test:</strong> <span id="test"></span></p>
    <p><strong>Status:</strong> <span id="status"></span></p>
    <p><strong>Counter:</strong> <span id="counter"></span></p>
    <h1>Benutzer</h1>
    <ul>
        {% for user in users %}
            <li>{{ user.name }}</li>
        {% endfor %}
    </ul>
    <script>
        const socket = io();
    
        socket.on('update_data', (data) => {
            document.getElementById('test').textContent = data.test;
            document.getElementById('status').textContent = data.status;
            document.getElementById('counter').textContent = data.counter;
        });
    </script>
    </body>
    </html>
    
</body>
</html>
