header

随笔分类 -  nodejs

摘要:io.on('connect', onConnect); function onConnect(socket){ // 只发给sender。 sending to the client socket.emit('hello', 'can you hear me?', 1, 2, 'abc'); // 发给所有人,除了sender。 sending to all clients ... 阅读全文
posted @ 2018-09-13 15:28 loganv 阅读(8238) 评论(0) 推荐(0)
摘要:官方API:http://socket.io/docs/server-api/ var io = require('socket.io')(http); var io = require('socket.io')(http); 有关 emit // 发送给 当前请求的socket客户端 socket 阅读全文
posted @ 2016-08-24 15:14 loganv
摘要:npm相关 保存到当前项目 npm install -save express 保存到node的全局目录 npm install -g express 其他npm命令 update \ uninstall \ list \ search \ init 更新至最新版本的 npm (利用淘宝的npm源) 阅读全文
posted @ 2016-08-23 16:44 loganv

footer