node.js使用ws模块的WebSocket服务,实现点对点私聊和群聊
这只是的简单的例子,通过网址参数控制自己的id,和私聊的对象http://localhost/ws.html?1:2 //我的id是1,我只能给2发消息 http://localhost/ws.html?1 //我的id是1,我一般不发,一发就是群发 http://localhost/ws.html?:1 //我没有id,我只能接收群发信息,我只能给1发消息 htt...
原创
2019-05-29 22:13:23 ·
5787 阅读 ·
0 评论