### Initialize and Manage Engine.IO and Socket.IO Connections Source: https://github.com/helyho/voovan/blob/master/Web/WEBAPP/socketio.html Functions to handle lifecycle events and messaging for Engine.IO and Socket.IO clients. Requires the respective client libraries to be loaded in the environment. ```javascript var engineObj; var socketObj; function engineio() { engineObj = new eio.Socket('/engineio', { transports: ['websocket'], path: "/engine.io"}); engineObj.on('open', function(){ console.log("open"); }); engineObj.on('message', function(data){ console.log(data); }); engineObj.on('close', function(data){ console.log(data); }); } function message(){ engineObj.send("ffff"); } function engineClose(){ engineObj.close(); } function socketio() { socketObj = io.connect('/socketio', { transports: ['websocket'], path: "/socket.io" }); socketObj.on("connect", function (x) { console.log("connect") }) socketObj.on("disconnect", function (x) { console.log("disconnect") }) socketObj.on("show", function (x) { console.log("show " + x) return "show back" }) } function emit() { socketObj.emit('hello', {testData: '123456'}, function(a){ console.log(a) }); } function socketClose(){ socketObj.close(); } ``` -------------------------------- ### Swagger UI CSS and Initialization Source: https://github.com/helyho/voovan/blob/master/Web/src/main/resources/org/voovan/http/server/conf/swagger.html Defines the minimum height for Swagger UI textareas and initializes the SwaggerUIBundle with specific configuration presets. ```css .swagger-ui textarea { min-height: 180px; } ``` ```javascript window.onload = function () { const ui = SwaggerUIBundle({ url: "/swagger", dom_id: '#swagger-ui', presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ], layout: "BaseLayout",//"StandaloneLayout","BaseLayout" filter: true, displayOperationId: true, displayRequestDuration: true, docExpansion: "none", syntaxHighlight: { theme: "nord" }, }); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.