【发布时间】:2016-08-13 10:15:37
【问题描述】:
socket.io 新手,想知道如果我想将会话 ID(http 请求)与套接字 ID 匹配,是否可以在 get 请求中启动套接字服务器?
app.get('/', function(req, res, next) {
res.render('index.ejs')
io.on('connection', function (socket) {
console.log(socket)
});
});
【问题讨论】: