![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
websocket
-布谷鸟-
这个作者很懒,什么都没留下…
展开
-
websocket:广播
先看看视频:服务端程序(websocket.js):var ws = require("nodejs-websocket");function now() { return new Date().toLocaleString();}var n = 0;var BC = 0;function broadcast(server) { if(BC>0) return; BC = setInterval(() => { n++;..原创 2021-06-20 12:17:23 · 789 阅读 · 1 评论 -
websocket:互动
服务端程序: 1 var ws = require("nodejs-websocket"); 2 3 function now() { 4 return new Date().toLocaleString(); 5 } 6 function broadcast(server, msg) { 7 server.connections.forEach(function (conn) { 8 conn.sendText(msg) 9 }...原创 2021-06-20 11:37:27 · 154 阅读 · 0 评论