
           <html>
                <head>
                    <title>WebSocket demo</title>
                </head>
                <body>
                <h1>kafka消息：</h1>
                    <script>
                        var ws = new WebSocket("ws://0.0.0.0:{{portNum}}/"),
                            messages = document.createElement('ul');
                        ws.onmessage = function (event) {
                            var messages = document.getElementsByTagName('ul')[0],
                                message = document.createElement('li'),
                                content = document.createTextNode(event.data);
                            message.appendChild(content);
                            messages.appendChild(message);
                        };
                        document.body.appendChild(messages);
                    </script>
                </body>
            </html>
        