         });
            }
        });

        socket.addEventListener('close', () => {
            console.log('WebSocket closed');
        });

        socket.addEventListener('error', (error) => {
            console.error('WebSocket error:', error);
        });
    </script>

    <script>
        document.getElementById('search-input').addEventListener('input', function (event) {
            const searchTerm = event.target.value.trim(); // 获取并清除输入框两边的空格
            const listI