企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
socket.io 执行命令: ``` npm install socket.io npm install express ``` ``` server.js const app = require('express')(); const http = require('http').createServer(app); const io = require('socket.io')(http); app.get('/', (req, res) => { res.sendFile(__dirname + '/index.html'); }); io.on('connection', (socket) => { console.log('a user connected'); }); http.listen(3000, () => { console.log('listening on *:3000'); }); ``` 执行:node server.js